Class ODataLiterals

java.lang.Object
io.skipcheck.tm1.client.odata.ODataLiterals

public final class ODataLiterals extends Object
OData literals, as they appear in keys, function parameters and $filter, before percent-encoding.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    A literal written exactly as given, such as ibm.tm1.api.v1.ElementType'Numeric' or 2026-11-21.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    enumMember(String qualifiedType, String member)
    An enumeration literal in OData 4.0 form, with its type: ibm.tm1.api.v1.ElementType'Numeric'.
    static String
    of(@Nullable Object value)
    A literal for a Java value: strings are quoted, numbers and booleans written as is, null as null.
    static String
    string(String value)
    A string literal: single-quoted, with single quotes doubled ('O''Neil').

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • string

      public static String string(String value)
      A string literal: single-quoted, with single quotes doubled ('O''Neil').
      Parameters:
      value - the text
      Returns:
      the quoted literal, not yet percent-encoded
    • enumMember

      public static String enumMember(String qualifiedType, String member)
      An enumeration literal in OData 4.0 form, with its type: ibm.tm1.api.v1.ElementType'Numeric'.
      Parameters:
      qualifiedType - the enumeration type's namespace-qualified name
      member - the member's name
      Returns:
      the literal, not yet percent-encoded
    • of

      public static String of(@Nullable Object value)
      A literal for a Java value: strings are quoted, numbers and booleans written as is, null as null. Use ODataLiterals.Raw for an already-formed literal, such as an enum member or a date.
      Parameters:
      value - the value, or null
      Returns:
      the literal, not yet percent-encoded
      Throws:
      IllegalArgumentException - for types with no unambiguous literal form