com.fatwire.services.beans
Class ServiceBean<T>

java.lang.Object
  extended by com.fatwire.services.beans.BaseBean
      extended by com.fatwire.services.beans.ServiceBean<T>
Type Parameters:
T - type of the entity encapsulated into this.
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
PermissionBean

public class ServiceBean<T>
extends BaseBean

This class is a generic abstraction for a value object returned from a service.

All services must use this bean to wrap object entities that they want to return. The response object provides the following information:
  1. a response object providing the success or error condition, along with localized messages and a status code
  2. an optional typed entity, which is customized to hold further information specific to the service for which this bean behaves as a value object.

See Also:
ServiceResponse, PermissionBean, Serialized Form

Field Summary
protected  T entity
          Entity associated with this service bean.
protected  ServiceResponse response
          Response object associated with this service bean.
 
Constructor Summary
ServiceBean()
           
 
Method Summary
 T getEntity()
           Returns the entity associated with this value object.
 ServiceResponse getResponse()
          Returns the response object associated with this value object.
 void setEntity(T entity)
           Sets the entity associated with this value object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

response

protected final ServiceResponse response
Response object associated with this service bean.


entity

protected T entity
Entity associated with this service bean.

Constructor Detail

ServiceBean

public ServiceBean()
Method Detail

getResponse

public ServiceResponse getResponse()
Returns the response object associated with this value object.

Returns:
the response object.
See Also:
ServiceResponse

setEntity

public void setEntity(T entity)

Sets the entity associated with this value object.

Typically the entity is used to hold extra information beyond the response, which will be specific to the service in which it is used.

Parameters:
entity - the entity to set into the value object.

getEntity

public T getEntity()

Returns the entity associated with this value object.

Typically the entity is used to hold extra information beyond the response, which will be specific to the service in which it is used.

Returns:
the entity associated with this value object.


Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.