com.atlassian.greenhopper.service.api
Class ResultFactory

java.lang.Object
  extended by com.atlassian.greenhopper.service.api.ResultFactory

@Service
public class ResultFactory
extends java.lang.Object

Factory for constructing service results in our API.

Since:
v5.8.1
Author:
mtokar

Constructor Summary
ResultFactory()
           
 
Method Summary
<T> com.atlassian.jira.bc.ServiceOutcome<T>
makeResult(ErrorCollection errors, T payload, com.atlassian.crowd.embedded.api.User user)
          Constructs a ServiceOutcome result from a payload and an ErrorCollection, which is converted into a JIRA ErrorCollection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultFactory

public ResultFactory()
Method Detail

makeResult

public <T> com.atlassian.jira.bc.ServiceOutcome<T> makeResult(ErrorCollection errors,
                                                              T payload,
                                                              com.atlassian.crowd.embedded.api.User user)
Constructs a ServiceOutcome result from a payload and an ErrorCollection, which is converted into a JIRA ErrorCollection.

The messages of the error collection are translated into the specified user's locale.

Type Parameters:
T - the type of the payload
Parameters:
errors - an errors which were generated by the service operation
payload - the payload from the service operation
user - the user who performed the service operation
Returns:
a result which either contains errors or the payload.


Copyright © 2007-2013 Atlassian. All Rights Reserved.