Class ThingFieldSelector

java.lang.Object
org.eclipse.ditto.things.model.ThingFieldSelector
All Implemented Interfaces:
Iterable<org.eclipse.ditto.json.JsonPointer>, org.eclipse.ditto.json.JsonFieldSelector

public final class ThingFieldSelector extends Object implements org.eclipse.ditto.json.JsonFieldSelector
A Json field selector which validates that only valid fields of a thing can be selected. Commas in keys are not supported by this selector.
Since:
2.0.0
  • Method Details

    • fromJsonFieldSelector

      public static ThingFieldSelector fromJsonFieldSelector(org.eclipse.ditto.json.JsonFieldSelector jsonFieldSelector)
      Creates a thing field selector based on the more generic json field selector. Selected fields are validated. If the given json field selector is already an instance of ThingFieldSelector the same instance will be returned.
      Parameters:
      jsonFieldSelector - the generic json field selector.
      Returns:
      the ThingFieldSelector.
      Throws:
      InvalidThingFieldSelectionException - when the given json field selector is null or contains invalid fields.
    • fromString

      public static ThingFieldSelector fromString(String selectionString)
      Creates a thing field selector based on the given string representation of a json field selector. Selected fields are validated.
      Parameters:
      selectionString - the string representation of a json field selector.
      Returns:
      the ThingFieldSelector.
      Throws:
      InvalidThingFieldSelectionException - when the given string is null or contains invalid fields.
    • getJsonFieldSelector

      public org.eclipse.ditto.json.JsonFieldSelector getJsonFieldSelector()
      Returns the underlying JsonFieldSelector.
      Returns:
      the underlying JsonFieldSelector.
    • equals

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

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

      public Set<org.eclipse.ditto.json.JsonPointer> getPointers()
      Specified by:
      getPointers in interface org.eclipse.ditto.json.JsonFieldSelector
    • getSize

      public int getSize()
      Specified by:
      getSize in interface org.eclipse.ditto.json.JsonFieldSelector
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.eclipse.ditto.json.JsonFieldSelector
    • toString

      public String toString()
      Specified by:
      toString in interface org.eclipse.ditto.json.JsonFieldSelector
      Overrides:
      toString in class Object
    • iterator

      public Iterator<org.eclipse.ditto.json.JsonPointer> iterator()
      Specified by:
      iterator in interface Iterable<org.eclipse.ditto.json.JsonPointer>