org.odata4j.producer
Class Responses

java.lang.Object
  extended by org.odata4j.producer.Responses

public class Responses
extends Object

A static factory to create immutable EntitiesResponse, EntityResponse, PropertyResponse, EntityIdResponse, ComplexObjectResponse, CollectionResponse, or ErrorResponse instances.


Method Summary
static
<T extends OObject>
CollectionResponse<?>
collection(OCollection<T> collection)
          Creates a new CollectionResponse instance.
static
<T extends OObject>
CollectionResponse<?>
collection(OCollection<T> collection, EdmEntitySet entitySet, Integer inlineCount, String skipToken, String collectionName)
          Creates a new CollectionResponse instance.
static ComplexObjectResponse complexObject(OComplexObject complexObject, String complexObjectName)
          Creates a new ComplexObjectResponse instance.
static CountResponse count(long count)
           
static EntitiesResponse entities(List<OEntity> entities, EdmEntitySet entitySet, Integer inlineCount, String skipToken)
          Creates a new EntitiesResponse instance.
static EntityResponse entity(OEntity entity)
          Creates a new EntityResponse instance.
static ErrorResponse error(OError error)
          Creates a new ErrorResponse instance.
static
<T extends OEntityId>
EntityIdResponse
multipleIds(Iterable<T> entityIds)
          Creates a new EntityIdResponse instance for payloads with a cardinality of EdmMultiplicity.MANY.
static PropertyResponse property(OProperty<?> property)
          Creates a new PropertyResponse instance.
static SimpleResponse simple(EdmSimpleType<?> type, Object value)
           
static SimpleResponse simple(EdmSimpleType<?> type, String name, Object value)
           
static
<T extends OEntityId>
EntityIdResponse
singleId(T entityId)
          Creates a new EntityIdResponse instance for payloads with a cardinality of EdmMultiplicity.ONE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

collection

public static <T extends OObject> CollectionResponse<?> collection(OCollection<T> collection)
Creates a new CollectionResponse instance.

Parameters:
collection - the collection
Returns:
a new ComplexObjectResponse instance

collection

public static <T extends OObject> CollectionResponse<?> collection(OCollection<T> collection,
                                                                   EdmEntitySet entitySet,
                                                                   Integer inlineCount,
                                                                   String skipToken,
                                                                   String collectionName)
Creates a new CollectionResponse instance.

Parameters:
collection - the collection
Returns:
a new ComplexObjectResponse instance

complexObject

public static ComplexObjectResponse complexObject(OComplexObject complexObject,
                                                  String complexObjectName)
Creates a new ComplexObjectResponse instance.

Parameters:
complexObject - the complex object
Returns:
a new ComplexObjectResponse instance

count

public static CountResponse count(long count)

entities

public static EntitiesResponse entities(List<OEntity> entities,
                                        EdmEntitySet entitySet,
                                        Integer inlineCount,
                                        String skipToken)
Creates a new EntitiesResponse instance.

Parameters:
entities - the OData entities, if any
entitySet - the entity-set
inlineCount - the inline-count value, if necessary
skipToken - the continuation-token, if necessary
Returns:
a new EntitiesResponse instance

entity

public static EntityResponse entity(OEntity entity)
Creates a new EntityResponse instance.

Parameters:
entity - the OData entity
Returns:
a new EntityResponse instance

error

public static ErrorResponse error(OError error)
Creates a new ErrorResponse instance.

Parameters:
error - the OData error
Returns:
a new ErrorResponse instance

multipleIds

public static <T extends OEntityId> EntityIdResponse multipleIds(Iterable<T> entityIds)
Creates a new EntityIdResponse instance for payloads with a cardinality of EdmMultiplicity.MANY.

Parameters:
entityIds - the payload entities
Returns:
a new EntityIdResponse instance

property

public static PropertyResponse property(OProperty<?> property)
Creates a new PropertyResponse instance.

Parameters:
property - the property value
Returns:
a new PropertyResponse instance

simple

public static SimpleResponse simple(EdmSimpleType<?> type,
                                    Object value)

simple

public static SimpleResponse simple(EdmSimpleType<?> type,
                                    String name,
                                    Object value)

singleId

public static <T extends OEntityId> EntityIdResponse singleId(T entityId)
Creates a new EntityIdResponse instance for payloads with a cardinality of EdmMultiplicity.ONE.

Parameters:
entityId - the payload entity
Returns:
a new EntityIdResponse instance


http://odata4j.org