Package io.skipcheck.tm1.client.odata
@NullMarked
package io.skipcheck.tm1.client.odata
OData v4 protocol support that knows nothing about TM1: building correctly encoded
resource paths and query options, the
$filter expression language, JSON control
information, and decoding collections as a stream.
TM1 declares OData 4.0, so everything here produces 4.0 forms: lowercase,
$-prefixed system query options, single-quoted string literals with doubled
quotes, and @odata.-prefixed control information.
Everything here is non-null unless marked Nullable.
-
ClassDescriptionA
$filterexpression, built fromODataPropertycomparisons and the canonical functions TM1 supports:Filter numericQ = Filter.and(Filter.startsWith(Element.NAME, "Q"), Element.TYPE.eq(ODataLiterals.enumMember("ibm.tm1.api.v1.ElementType", "Numeric"))); // (startswith(Name,'Q') and (Type eq ibm.tm1.api.v1.ElementType'Numeric')) Filter hasRegion = Filter.any("Hierarchies", "h", (h) -> h.nav("Name").eq("Region")); // Hierarchies/any(h:h/Name eq 'Region')A lambda's range variable, the root of paths inside it.Reads anEdm.DateTimeOffsetthat a server sometimes fills with something that isn't one, such as TM1's0000-00-00T00:00Z: asnull, rather than failing the whole response.Decodes an OData collection response,{"@odata.context":..., "value":[...]}, item by item as the bytes arrive, without ever holding the whole response.An item or a piece of control information from a collection response.A top-level property other thanvalue, such as@odata.nextLink.One member ofvalue.Percent-encoding for OData URLs, applied exactly once to each piece (OData Part 2 §2.1).OData 4.0 JSON control information names, and helpers for writing them.A value that knows how to write itself as an OData literal, such as the generated enums (ibm.tm1.api.v1.ElementType'Numeric');ODataLiterals.of(Object)uses it.OData literals, as they appear in keys, function parameters and$filter, before percent-encoding.A literal written exactly as given, such asibm.tm1.api.v1.ElementType'Numeric'or2026-11-21.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.ReserveA parameter alias used as a function parameter value:tm1.Fn(p=@p), with@pdefined in the query (ODataQuery.alias(ODataPath.Alias, String)).A property path for queries, such asNameorHierarchy/Name.OData query options:$select,$expand(with nested options),$filter,$orderby,$top,$skip,$count, custom options such as TM1's!sandbox, and parameter aliases.Makes a response's bytes valid UTF-8 before they're read as JSON: each byte that isn't part of a character becomes U+FFFD, the replacement character, and everything else is kept as it is.