org.odata4j.core
Class OEntityIds

java.lang.Object
  extended by org.odata4j.core.OEntityIds

public class OEntityIds
extends Object

A static factory to create immutable OEntityId instances.


Method Summary
static OEntityId create(String entitySetName, Object... entityKeyValues)
          Creates an entity-id.
static OEntityId create(String entitySetName, OEntityKey entityKey)
          Creates an entity-id.
static boolean equals(OEntityId lhs, OEntityId rhs)
          Determines equality of two entity ids.
static OEntityId parse(String entityId)
          Parses an entity-id from a "key string" representation.
static OEntityId parse(String serviceRootUri, String uri)
          Parses an entity-id of an entity at an OData uri given its service root uri.
static String toKeyString(OEntityId entity)
          Computes the "key string" representation of an entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static OEntityId create(String entitySetName,
                               Object... entityKeyValues)
Creates an entity-id.

Parameters:
entitySetName - the entity-set
entityKeyValues - the entity-key as one or more values
Returns:
the entity-id

create

public static OEntityId create(String entitySetName,
                               OEntityKey entityKey)
Creates an entity-id.

Parameters:
entitySetName - the entity-set
entityKey - the entity-key
Returns:
the entity-id

equals

public static boolean equals(OEntityId lhs,
                             OEntityId rhs)
Determines equality of two entity ids. Ids are equal if their key strings are equal.

Parameters:
lhs - the first entity id
rhs - the second entity id
Returns:
whether or not the ids are equal

parse

public static OEntityId parse(String entityId)
Parses an entity-id from a "key string" representation.

e.g. Customers(15)

Parameters:
entityId - the entity-id as a string representation
Returns:
the parsed entity-id

parse

public static OEntityId parse(String serviceRootUri,
                              String uri)
Parses an entity-id of an entity at an OData uri given its service root uri.

Parameters:
serviceRootUri - the service root uri
uri - the entity uri
Returns:
the parsed entity-id

toKeyString

public static String toKeyString(OEntityId entity)
Computes the "key string" representation of an entity.

Parameters:
entity - the entity
Returns:
the "key string" representation e.g. Customers(15)


http://odata4j.org