Class ParsedPlaceholder

java.lang.Object
org.eclipse.ditto.rql.model.ParsedPlaceholder
All Implemented Interfaces:
CharSequence

@Immutable public final class ParsedPlaceholder extends Object implements CharSequence
Holds a String representing a Placeholder in the form: prefix:name. The supported placeholder prefixes are defined in the RqlPredicateParser.
  • Method Details

    • of

      public static ParsedPlaceholder of(CharSequence placeholderWithPrefix)
      Creates a new ParsedPlaceholder from the passed char sequence ensuring that it is in the format <prefix>:<name>.
      Parameters:
      placeholderWithPrefix - the char sequence containing the placeholder in format <prefix>:<name>.
      Returns:
      the ParsedPlaceholder instance.
      Throws:
      NullPointerException - if the passed placeholderWithPrefix was null.
      IllegalArgumentException - if the passed placeholderWithPrefix was not in the expected format.
    • getPrefix

      public String getPrefix()
      Returns the placeholder prefix.
      Returns:
      the placeholder prefix.
    • getName

      public String getName()
      Returns the placeholder name.
      Returns:
      the placeholder name.
    • length

      public int length()
      Specified by:
      length in interface CharSequence
    • charAt

      public char charAt(int index)
      Specified by:
      charAt in interface CharSequence
    • subSequence

      public CharSequence subSequence(int start, int end)
      Specified by:
      subSequence in interface CharSequence
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Specified by:
      toString in interface CharSequence
      Overrides:
      toString in class Object