Package org.eclipse.ditto.things.model
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 Summary
Modifier and TypeMethodDescriptionbooleanstatic ThingFieldSelectorfromJsonFieldSelector(org.eclipse.ditto.json.JsonFieldSelector jsonFieldSelector) Creates a thing field selector based on the more generic json field selector.static ThingFieldSelectorfromString(String selectionString) Creates a thing field selector based on the given string representation of a json field selector.org.eclipse.ditto.json.JsonFieldSelectorReturns the underlying JsonFieldSelector.Set<org.eclipse.ditto.json.JsonPointer>intgetSize()inthashCode()booleanisEmpty()Iterator<org.eclipse.ditto.json.JsonPointer>iterator()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
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 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
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
-
hashCode
public int hashCode() -
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
-
iterator
-