Interface ValueCreator
-
- All Known Implementing Classes:
ValueCreatorProvider
public interface ValueCreator
An interface defining an OSGi service containing methods to convertBoolean
,Long
,Double
andString
toValue
objects. There are also methods to create a newPropertyset
instance and to convert aPropertyset
to a complex value (nested object) and to convert aPropertyset
to a reference value (a "pointer").
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Value
fromBoolean(Boolean value)
Value
fromDouble(Double value)
Value
fromLong(Long value)
Value
fromString(String value)
Value
fromValueList(ValueList valueList)
Value
getNil()
Return an object that can be used to represent undefinedValue
valuesPropertyset
getNilPropertyset()
Return an object that can be used to represent undefinedPropertyset
valuesPropertyset
newPropertyset()
Create a new, empty, id-lessPropertyset
.Propertyset
newPropertyset(UUID id)
Create a new, emptyPropertyset
with a given id valueValueList
newValueList()
Value
toComplexValue(Propertyset propertyset)
Create an embedded object value from a propertysetValue
toReferenceValue(Propertyset propertyset)
Create a reference value to a propertyset (a "pointer to an object")Propertyset
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.Propertyset
wrapInModificationTracker(ModificationRecorder recorder, Propertyset propertyset)
Wrap aPropertyset
in a newPropertyset
that will record all modifications to the propertyset in aModificationRecorder
.
-
-
-
Method Detail
-
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
-
newPropertyset
Propertyset newPropertyset()
Create a new, empty, id-lessPropertyset
. Id-less propertysets are intended as complex properties.- Returns:
- a new
Propertyset
value
-
newPropertyset
Propertyset newPropertyset(UUID id)
Create a new, emptyPropertyset
with a given id value- Parameters:
id
- the unique identifier of the newPropertyset
- Returns:
- a new
Propertyset
value
-
wrapInModificationTracker
Propertyset wrapInModificationTracker(ModificationRecorder recorder, Propertyset propertyset)
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
Propertyset 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.- Parameters:
propertyset
- the propertyset to unwrap- Returns:
- the unwrapped propertyset
-
toComplexValue
Value toComplexValue(Propertyset propertyset)
Create an embedded object value from a propertyset- Parameters:
propertyset
- the object to put in the value- Returns:
- a complex object
Value
-
toReferenceValue
Value toReferenceValue(Propertyset propertyset)
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()
-
-