Class ValueCreatorProvider
- java.lang.Object
-
- no.priv.bang.modeling.modelstore.value.ValueCreatorProvider
-
- All Implemented Interfaces:
ValueCreator
public class ValueCreatorProvider extends Object implements ValueCreator
-
-
Constructor Summary
Constructors Constructor Description ValueCreatorProvider()
-
Method Summary
All Methods Instance Methods Concrete 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
public Propertyset getNilPropertyset()
Description copied from interface:ValueCreator
Return an object that can be used to represent undefinedPropertyset
values- Specified by:
getNilPropertyset
in interfaceValueCreator
- Returns:
- an unmodifiable
Value
object that tests as aPropertyset
value
-
getNil
public Value getNil()
Description copied from interface:ValueCreator
Return an object that can be used to represent undefinedValue
values- Specified by:
getNil
in interfaceValueCreator
- Returns:
- and unmodifiable
Value
that represents undefined values
-
fromBoolean
public Value fromBoolean(Boolean value)
Description copied from interface:ValueCreator
- Specified by:
fromBoolean
in interfaceValueCreator
- Parameters:
value
- aBoolean
to convert- Returns:
- a
Value
that will test out as a boolean value
-
fromLong
public Value fromLong(Long value)
Description copied from interface:ValueCreator
- Specified by:
fromLong
in interfaceValueCreator
- Parameters:
value
- aLong
to convert- Returns:
- a
Value
that will test out as a long integer value
-
fromDouble
public Value fromDouble(Double value)
Description copied from interface:ValueCreator
- Specified by:
fromDouble
in interfaceValueCreator
- Parameters:
value
- aDouble
to convert- Returns:
- a
Value
that will test out as a floating point number value
-
fromString
public Value fromString(String value)
Description copied from interface:ValueCreator
- Specified by:
fromString
in interfaceValueCreator
- Parameters:
value
- aDouble
to convert- Returns:
- a
Value
that will test out as a string value
-
fromValueList
public Value fromValueList(ValueList valueList)
- Specified by:
fromValueList
in interfaceValueCreator
-
newPropertyset
public Propertyset newPropertyset()
Description copied from interface:ValueCreator
Create a new, empty, id-lessPropertyset
. Id-less propertysets are intended as complex properties.- Specified by:
newPropertyset
in interfaceValueCreator
- Returns:
- a new
Propertyset
value
-
newPropertyset
public Propertyset newPropertyset(UUID id)
Description copied from interface:ValueCreator
Create a new, emptyPropertyset
with a given id value- Specified by:
newPropertyset
in interfaceValueCreator
- Parameters:
id
- the unique identifier of the newPropertyset
- Returns:
- a new
Propertyset
value
-
wrapInModificationTracker
public Propertyset wrapInModificationTracker(ModificationRecorder recorder, Propertyset propertyset)
Description copied from interface:ValueCreator
Wrap aPropertyset
in a newPropertyset
that will record all modifications to the propertyset in aModificationRecorder
.- Specified by:
wrapInModificationTracker
in interfaceValueCreator
- Parameters:
recorder
- theModificationRecorder
used to track modifications to thePropertyset
propertyset
- the wrappedPropertyset
- Returns:
- a
Propertyset
that will track all modifications in aModificationRecorder
-
unwrapPropertyset
public Propertyset unwrapPropertyset(Propertyset propertyset)
Description copied from interface:ValueCreator
If the propertyset is wrapped in a different propertyset, then return the inner propertyset if not, just return the argument as-is.- Specified by:
unwrapPropertyset
in interfaceValueCreator
- Parameters:
propertyset
- the propertyset to unwrap- Returns:
- the unwrapped propertyset
-
toComplexValue
public Value toComplexValue(Propertyset propertyset)
Description copied from interface:ValueCreator
Create an embedded object value from a propertyset- Specified by:
toComplexValue
in interfaceValueCreator
- Parameters:
propertyset
- the object to put in the value- Returns:
- a complex object
Value
-
toReferenceValue
public Value toReferenceValue(Propertyset propertyset)
Description copied from interface:ValueCreator
Create a reference value to a propertyset (a "pointer to an object")- Specified by:
toReferenceValue
in interfaceValueCreator
- Parameters:
propertyset
- the object to create a pointer to- Returns:
- a "pointer"
Value
-
newValueList
public ValueList newValueList()
- Specified by:
newValueList
in interfaceValueCreator
-
-