Class ODataPath
java.lang.Object
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA parameter alias used as a function parameter value:tm1.Fn(p=@p), with@pdefined in the query (ODataQuery.alias(ODataPath.Alias, String)). -
Method Summary
Modifier and TypeMethodDescriptionAdds a bound action segment, e.g.static ODataPathbatch()The service's batch endpoint,$batch: a path of its own, as formetadata().Adds a type-cast segment, e.g.count()Adds$count: the number of items in a collection, as plain text.booleanAdds a bound function call with literal parameters, e.g.static ODataPathfunctionImport(String name, Map<String, ?> parameters) A function import called from the service root, e.g.inthashCode()Adds a single-part key with a non-string value, such as a number:(42).Adds a single-part key with a string value:('Sales').Adds a compound key, in the order given:(ParentName='Total',ComponentName='Q1').static ODataPathA path a server returned, such as a delta link (MessageLogEntries/!delta('…')), relative to the service root and not yet encoded: each segment is percent-encoded as it is (keeping!,(,)and'), without checking it's an identifier.static ODataPathmetadata()The service's metadata document,$metadata: its CSDL XML.Adds a navigation property or structural property segment, e.g.static ODataPathA path starting at an entity set, singleton or operation import, e.g.ref()Adds$ref: references to entities rather than the entities themselves.toString()The encoded path, without a leading slash, e.g.value()Adds$value: a property's or media entity's raw value.
-
Method Details
-
of
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- ifnameisn't an identifier
-
metadata
The service's metadata document,$metadata: its CSDL XML. A path of its own, since$metadataisn't an identifierof(String)accepts.- Returns:
- the path
-
batch
The service's batch endpoint,$batch: a path of its own, as formetadata().- Returns:
- the path
-
key
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
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(Object)); text is treated as bykey(String)- Returns:
- a new path with the key on its last segment
-
key
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- ifpartsis empty
-
cast
-
action
-
function
Adds a bound function call with literal parameters, e.g.tm1.GetPartition(Begin=0,End=99). Use parameter aliases (inODataQuery) for complex or collection parameters.- Parameters:
qualifiedName- the namespace-qualified function nameparameters- the parameter names and values, in order; each value is written as an OData literal, or as the alias's name if it's anODataPath.Alias- Returns:
- a new path with the segment added
-
link
A path a server returned, such as a delta link (MessageLogEntries/!delta('…')), relative to the service root and not yet encoded: each segment is percent-encoded as it is (keeping!,(,)and'), without checking it's an identifier.- Parameters:
link- the path, without a query- Returns:
- the path
- Throws:
IllegalArgumentException- if it's empty, absolute or has a query
-
functionImport
A function import called from the service root, e.g.ModelCubes()orTailMessageLog(Top=10).- Parameters:
name- the import's name, unqualifiedparameters- the parameter names and values, in order, as forfunction(String, Map)- Returns:
- the path
-
value
Adds$value: a property's or media entity's raw value.- Returns:
- a new path with the segment added
-
count
Adds$count: the number of items in a collection, as plain text.- Returns:
- a new path with the segment added
-
ref
Adds$ref: references to entities rather than the entities themselves.- Returns:
- a new path with the segment added
-
toString
-
equals
-
hashCode
-