Package org.eclipse.ditto.things.model
Class ThingFieldSelector
- java.lang.Object
-
- org.eclipse.ditto.things.model.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.JsonFieldSelectorA 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 booleanequals(java.lang.Object o)static ThingFieldSelectorfromJsonFieldSelector(org.eclipse.ditto.json.JsonFieldSelector jsonFieldSelector)Creates a thing field selector based on the more generic json field selector.static ThingFieldSelectorfromString(java.lang.String selectionString)Creates a thing field selector based on the given string representation of a json field selector.org.eclipse.ditto.json.JsonFieldSelectorgetJsonFieldSelector()Returns the underlying JsonFieldSelector.java.util.Set<org.eclipse.ditto.json.JsonPointer>getPointers()intgetSize()inthashCode()booleanisEmpty()java.util.Iterator<org.eclipse.ditto.json.JsonPointer>iterator()java.lang.StringtoString()
-
-
-
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 ofThingFieldSelectorthe same instance will be returned.- Parameters:
jsonFieldSelector- the generic json field selector.- Returns:
- the ThingFieldSelector.
- Throws:
InvalidThingFieldSelectionException- when the given json field selector isnullor 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 isnullor 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getPointers
public java.util.Set<org.eclipse.ditto.json.JsonPointer> getPointers()
- Specified by:
getPointersin interfaceorg.eclipse.ditto.json.JsonFieldSelector
-
getSize
public int getSize()
- Specified by:
getSizein interfaceorg.eclipse.ditto.json.JsonFieldSelector
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceorg.eclipse.ditto.json.JsonFieldSelector
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfaceorg.eclipse.ditto.json.JsonFieldSelector- Overrides:
toStringin classjava.lang.Object
-
iterator
public java.util.Iterator<org.eclipse.ditto.json.JsonPointer> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<org.eclipse.ditto.json.JsonPointer>
-
-