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 Details

    • getNilPropertyset

      Propertyset getNilPropertyset()
      Return an object that can be used to represent undefined Propertyset values
      Returns:
      an unmodifiable Value object that tests as a Propertyset value
    • getNil

      Value getNil()
      Return an object that can be used to represent undefined Value values
      Returns:
      and unmodifiable Value that represents undefined values
    • fromBoolean

      Value fromBoolean(Boolean value)
      Convert a Boolean into Value.
      Parameters:
      value - a Boolean to convert
      Returns:
      a Value that will test out as a boolean value
    • fromLong

      Value fromLong(Long value)
      Convert a Long into Value.
      Parameters:
      value - a Long to convert
      Returns:
      a Value that will test out as a long integer value
    • fromDouble

      Value fromDouble(Double value)
      Convert a Double into Value.
      Parameters:
      value - a Double to convert
      Returns:
      a Value that will test out as a floating point number value
    • fromString

      Value fromString(String value)
      Convert a String into Value.
      Parameters:
      value - a Double to convert
      Returns:
      a Value that will test out as a string value
    • fromValueList

      Value fromValueList(ValueList valueList)
    • newPropertyset

      Propertyset newPropertyset()
      Create a new, empty, id-less Propertyset. Id-less propertysets are intended as complex properties.
      Returns:
      a new Propertyset value
    • newPropertyset

      Propertyset newPropertyset(UUID id)
      Create a new, empty Propertyset with a given id value
      Parameters:
      id - the unique identifier of the new Propertyset
      Returns:
      a new Propertyset value
    • wrapInModificationTracker

      Propertyset wrapInModificationTracker(ModificationRecorder recorder, Propertyset propertyset)
      Wrap a Propertyset in a new Propertyset that will record all modifications to the propertyset in a ModificationRecorder.
      Parameters:
      recorder - the ModificationRecorder used to track modifications to the Propertyset
      propertyset - the wrapped Propertyset
      Returns:
      a Propertyset that will track all modifications in a ModificationRecorder
    • 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()