Interface ValueCreator
- All Known Implementing Classes:
ValueCreatorProvider
public interface ValueCreator
An interface defining an OSGi service containing methods to convert
Boolean, Long, Double and String
to Value objects.
There are also methods to create a new Propertyset instance
and to convert a Propertyset to a complex value (nested object)
and to convert a Propertyset to a reference value (a "pointer").-
Method Summary
Modifier and TypeMethodDescriptionfromBoolean(Boolean value) fromDouble(Double value) fromString(String value) fromValueList(ValueList valueList) getNil()Return an object that can be used to represent undefinedValuevaluesReturn an object that can be used to represent undefinedPropertysetvaluesCreate a new, empty, id-lessPropertyset.newPropertyset(UUID id) Create a new, emptyPropertysetwith a given id valuetoComplexValue(Propertyset propertyset) Create an embedded object value from a propertysettoReferenceValue(Propertyset propertyset) Create a reference value to a propertyset (a "pointer to an object")unwrapPropertyset(Propertyset propertyset) If the propertyset is wrapped in a different propertyset, then return the inner propertyset if not, just return the argument as-is.wrapInModificationTracker(ModificationRecorder recorder, Propertyset propertyset) Wrap aPropertysetin a newPropertysetthat will record all modifications to the propertyset in aModificationRecorder.
-
Method Details
-
getNilPropertyset
Propertyset getNilPropertyset()Return an object that can be used to represent undefinedPropertysetvalues- Returns:
- an unmodifiable
Valueobject that tests as aPropertysetvalue
-
getNil
Value getNil()Return an object that can be used to represent undefinedValuevalues- Returns:
- and unmodifiable
Valuethat represents undefined values
-
fromBoolean
-
fromLong
-
fromDouble
-
fromString
-
fromValueList
-
newPropertyset
Propertyset newPropertyset()Create a new, empty, id-lessPropertyset. Id-less propertysets are intended as complex properties.- Returns:
- a new
Propertysetvalue
-
newPropertyset
Create a new, emptyPropertysetwith a given id value- Parameters:
id- the unique identifier of the newPropertyset- Returns:
- a new
Propertysetvalue
-
wrapInModificationTracker
Wrap aPropertysetin a newPropertysetthat will record all modifications to the propertyset in aModificationRecorder.- Parameters:
recorder- theModificationRecorderused to track modifications to thePropertysetpropertyset- the wrappedPropertyset- Returns:
- a
Propertysetthat will track all modifications in aModificationRecorder
-
unwrapPropertyset
If the propertyset is wrapped in a different propertyset, then return the inner propertyset if not, just return the argument as-is.- Parameters:
propertyset- the propertyset to unwrap- Returns:
- the unwrapped propertyset
-
toComplexValue
Create an embedded object value from a propertyset- Parameters:
propertyset- the object to put in the value- Returns:
- a complex object
Value
-
toReferenceValue
Create a reference value to a propertyset (a "pointer to an object")- Parameters:
propertyset- the object to create a pointer to- Returns:
- a "pointer"
Value
-
newValueList
ValueList newValueList()
-