Class ThingFieldSelector

  • All Implemented Interfaces:
    java.lang.Iterable<org.eclipse.ditto.json.JsonPointer>, org.eclipse.ditto.json.JsonFieldSelector

    public final class ThingFieldSelector
    extends java.lang.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 Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      static ThingFieldSelector fromJsonFieldSelector​(org.eclipse.ditto.json.JsonFieldSelector jsonFieldSelector)
      Creates a thing field selector based on the more generic json field selector.
      static ThingFieldSelector fromString​(java.lang.String selectionString)
      Creates a thing field selector based on the given string representation of a json field selector.
      org.eclipse.ditto.json.JsonFieldSelector getJsonFieldSelector()
      Returns the underlying JsonFieldSelector.
      java.util.Set<org.eclipse.ditto.json.JsonPointer> getPointers()  
      int getSize()  
      int hashCode()  
      boolean isEmpty()  
      java.util.Iterator<org.eclipse.ditto.json.JsonPointer> iterator()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • 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​(java.lang.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​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.util.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 java.lang.String toString()
        Specified by:
        toString in interface org.eclipse.ditto.json.JsonFieldSelector
        Overrides:
        toString in class java.lang.Object
      • iterator

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