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 undefinedValue
valuesReturn an object that can be used to represent undefinedPropertyset
valuesCreate a new, empty, id-lessPropertyset
.newPropertyset
(UUID id) Create a new, emptyPropertyset
with 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 aPropertyset
in a newPropertyset
that will record all modifications to the propertyset in aModificationRecorder
.
-
Method Details
-
getNilPropertyset
Propertyset getNilPropertyset()Return an object that can be used to represent undefinedPropertyset
values- Returns:
- an unmodifiable
Value
object that tests as aPropertyset
value
-
getNil
Value getNil()Return an object that can be used to represent undefinedValue
values- Returns:
- and unmodifiable
Value
that 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
Propertyset
value
-
newPropertyset
Create a new, emptyPropertyset
with a given id value- Parameters:
id
- the unique identifier of the newPropertyset
- Returns:
- a new
Propertyset
value
-
wrapInModificationTracker
Wrap aPropertyset
in a newPropertyset
that will record all modifications to the propertyset in aModificationRecorder
.- Parameters:
recorder
- theModificationRecorder
used to track modifications to thePropertyset
propertyset
- the wrappedPropertyset
- Returns:
- a
Propertyset
that 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()
-