skipcheck

TM1 client · Docs · Queries

ODataPath

import io.skipcheck.tm1.client.odata.ODataPath;

A resource path relative to the service root, built from segments and encoded as it's built:

ODataPath element = ODataPath.of("Dimensions")
    .key("Region")
    .nav("Hierarchies")
    .key("Region")
    .nav("Elements")
    .key("O'Neil");
// Dimensions('Region')/Hierarchies('Region')/Elements('O''Neil')
ODataPath reserve = ODataPath.of("Cubes").key("Sales").action("tm1.Reserve");
// Cubes('Sales')/tm1.Reserve

Names (entity sets, navigation properties, operations, type casts) must be OData identifiers, optionally qualified; they're checked, never encoded. Key values can be any text: they're written as string literals and percent-encoded. Paths are immutable.

Members

of staticA path starting at an entity set, singleton or operation import, e.g.
metadata staticThe service's metadata document, $metadata.
batch staticThe service's batch endpoint, $batch.
keyAdds a single-part key with a string value.
keyAdds a single-part key with a non-string value, such as a number.
keyAdds a compound key, in the order given.
navAdds a navigation property or structural property segment, e.g.
castAdds a type-cast segment, e.g.
actionAdds a bound action segment, e.g.
functionAdds a bound function call with literal parameters, e.g.
link staticA path a server returned, such as a delta link (MessageLogEntries/!delta('…')), relative to the service root and not yet encoded.
functionImport staticA function import called from the service root, e.g.
valueAdds $value.
countAdds $count.
refAdds $ref.
toStringThe encoded path, without a leading slash, e.g.
equals
hashCode

of

static
static ODataPath of(String name)

A path starting at an entity set, singleton or operation import, e.g. Cubes.

Parameters

name
the first segment's name, an OData identifier

Returns

a one-segment path

Throws

IllegalArgumentException
if name isn't an identifier

metadata

static
static ODataPath metadata()

The service's metadata document, $metadata: its CSDL XML. A path of its own, since $metadata isn't an identifier of accepts.

Returns

the path

batch

static
static ODataPath batch()

The service's batch endpoint, $batch: a path of its own, as for metadata.

Returns

the path

key

ODataPath key(String value)

Adds a single-part key with a string value: ('Sales').

Parameters

value
the key value, any text; quoted and percent-encoded

Returns

a new path with the key on its last segment

Throws

IllegalStateException
if the last segment already has a key or is a $ segment

key

ODataPath key(Object value)

Adds a single-part key with a non-string value, such as a number: (42).

Parameters

value
the key value, written as an OData literal (ODataLiterals.of); text is treated as by key

Returns

a new path with the key on its last segment

key

ODataPath key(Map<String,?> parts)

Adds a compound key, in the order given: (ParentName='Total',ComponentName='Q1').

Parameters

parts
the key's property names (identifiers) and values, in order

Returns

a new path with the key on its last segment

Throws

IllegalArgumentException
if parts is empty

cast

ODataPath cast(String qualifiedType)

Adds a type-cast segment, e.g. tm1.NativeView.

Parameters

qualifiedType
the namespace-qualified type name

Returns

a new path with the segment added

action

ODataPath action(String qualifiedName)

Adds a bound action segment, e.g. tm1.Reserve. Actions are invoked with POST.

Parameters

qualifiedName
the namespace-qualified action name

Returns

a new path with the segment added

function

ODataPath function(String qualifiedName, Map<String,?> parameters)

Adds a bound function call with literal parameters, e.g. tm1.GetPartition(Begin=0,End=99). Use parameter aliases (in ODataQuery) for complex or collection parameters.

Parameters

qualifiedName
the namespace-qualified function name
parameters
the parameter names and values, in order; each value is written as an OData literal, or as the alias's name if it's an ODataPath.Alias

Returns

a new path with the segment added

functionImport

static
static ODataPath functionImport(String name, Map<String,?> parameters)

A function import called from the service root, e.g. ModelCubes() or TailMessageLog(Top=10).

Parameters

name
the import's name, unqualified
parameters
the parameter names and values, in order, as for function

Returns

the path

value

ODataPath value()

Adds $value: a property's or media entity's raw value.

Returns

a new path with the segment added

count

ODataPath count()

Adds $count: the number of items in a collection, as plain text.

Returns

a new path with the segment added

ref

ODataPath ref()

Adds $ref: references to entities rather than the entities themselves.

Returns

a new path with the segment added

toString

String toString()

The encoded path, without a leading slash, e.g. Cubes('Sales')/Views.

equals

boolean equals(Object o)

hashCode

int hashCode()

Also in the Javadoc.