public class

OEntityIds

extends Object
java.lang.Object
   ↳ org.odata4j.core.OEntityIds

Class Overview

A static factory to create immutable OEntityId instances.

Summary

Public Methods
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 serviceRootUri, String uri)
Parses an entity-id of an entity at an OData uri given its service root uri.
static OEntityId parse(String entityId)
Parses an entity-id from a "key string" representation.
static String toKeyString(OEntityId entity)
Computes the "key string" representation of an entity.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

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

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

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

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

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

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)