ODataEncoding
import io.skipcheck.tm1.client.odata.ODataEncoding;Percent-encoding for OData URLs, applied exactly once to each piece (OData Part 2 §2.1).
TM1 object names contain almost anything: Clients}, Year 2026,
O'Neil, a/b, 50%, {x}, &=+#. Two rules, one per
place a value can go, keep them intact:
pathValue: inside a path segment, such as a key literal. Only unreserved characters and'are left as is;/becomes%2F.queryValue: a query option's value. The OData punctuation used inside values ($ ( ) , ; ' : @ / ! *) is kept readable;& = + #and everything else is encoded, so a value can't split or end the query. A space is%20, never+.
Members
pathValue static | Encodes text for use inside a path segment, e.g. |
queryValue static | Encodes text for use as (part of) a query option's value. |
pathValue
staticstatic String pathValue(String text)Encodes text for use inside a path segment, e.g. the inside of a key literal.
Parameters
text- the unencoded text
Returns
- the percent-encoded text
queryValue
staticstatic String queryValue(String text)Encodes text for use as (part of) a query option's value.
Parameters
text- the unencoded text
Returns
- the percent-encoded text
Also in the Javadoc.