Class NodePropertyValue

    • Field Detail

      • EMPTY_COLLECTION_VALUE

        public static final Serializable EMPTY_COLLECTION_VALUE
        used to provide empty collection values in and out
  • Constructor Detail

    • NodePropertyValue

      public NodePropertyValue()
      default constructor
    • NodePropertyValue

      public NodePropertyValue​(QName typeQName,
                               Serializable value)
      Construct a new property value.
      Parameters:
      typeQName - the dictionary-defined property type to store the property as
      value - the value to store. This will be converted into a format compatible with the type given
      Throws:
      UnsupportedOperationException - if the value cannot be converted to the type given
  • Method Detail

    • convertToTypeOrdinal

      public static int convertToTypeOrdinal​(QName typeQName)
      Given an actual type qualified name, returns the int ordinal number that represents it in the database.
      Parameters:
      typeQName - the type qualified name
      Returns:
      Returns the int representation of the type, e.g. CONTENT.getOrdinalNumber() for type d:content.
    • isDataTypeSupported

      public static boolean isDataTypeSupported​(QName typeQName)
      If property value of the type QName is supported
      Parameters:
      typeQName - the type qualified name
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getActualType

      public Integer getActualType()
    • getActualTypeString

      public String getActualTypeString()
      Returns:
      Returns the actual type's String representation
    • setActualType

      public void setActualType​(Integer actualType)
    • getPersistedType

      public Integer getPersistedType()
    • setPersistedType

      public void setPersistedType​(Integer persistedType)
    • setPersistedValue

      public void setPersistedValue​(org.alfresco.repo.domain.node.NodePropertyValue.ValueType persistedType,
                                    Serializable value)
      Stores the value in the correct slot based on the type of persistence requested. No conversion is done.
      Parameters:
      persistedType - the value type
      value - the value - it may only be null if the persisted type is ValueType#NULL
    • getValue

      public Serializable getValue​(QName typeQName)
      Fetches the value as a desired type. Collections (i.e. multi-valued properties) will be converted as a whole to ensure that all the values returned within the collection match the given type.
      Parameters:
      typeQName - the type required for the return value
      Returns:
      Returns the value of this property as the desired type, or a Collection of values of the required type
      Throws:
      AlfrescoRuntimeException - if the type given is not recognized
      TypeConversionException - if the conversion to the required type fails
      See Also:
      The static qualified names for the types
    • getBooleanValue

      public boolean getBooleanValue()
    • setBooleanValue

      public void setBooleanValue​(boolean value)
    • getLongValue

      public long getLongValue()
    • setLongValue

      public void setLongValue​(long value)
    • getFloatValue

      public float getFloatValue()
    • setFloatValue

      public void setFloatValue​(float value)
    • getDoubleValue

      public double getDoubleValue()
    • setDoubleValue

      public void setDoubleValue​(double value)
    • getStringValue

      public String getStringValue()
    • setStringValue

      public void setStringValue​(String value)
    • getSerializableValue

      public Serializable getSerializableValue()
    • setSerializableValue

      public void setSerializableValue​(Serializable value)