Class Valuable

java.lang.Object
org.apache.olingo.commons.api.data.Annotatable
org.apache.olingo.commons.api.data.Valuable
Direct Known Subclasses:
Annotation, Parameter, Property

public abstract class Valuable extends Annotatable
Defines a value with an according type.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<?>
    Get the value as collection or null if it is not a collection ValueType
    Get the value in its complex representation or null if it is not based on a complex ValueType
    Get the value in its enum representation or null if it is not based on a enum ValueType
    Get the value in its geospatial representation or null if it is not based on a geospatial ValueType
    Get the value in its primitive representation or null if it is not based on a primitive ValueType
    boolean
     
    Get string representation of type (can be null if not set).
    Get the value
    Get value type for this valuable.
    int
     
    boolean
    Check if Valuable contains a COLLECTION_* ValueType
    boolean
    Check if Valuable contains a COMPLEX or COLLECTION_COMPLEX ValueType
    boolean
    Check if Valuable contains a ENUM or COLLECTION_ENUM ValueType
    boolean
    Check if Valuable contains a GEOSPATIAL or COLLECTION_GEOSPATIAL ValueType
    boolean
    Check if according value is null.
    boolean
    Check if Valuable contains a PRIMITIVE or COLLECTION_PRIMITIVE ValueType
    void
    Set string representation of type.
    void
    setValue(ValueType valueType, Object value)
    Set value and value type.
     

    Methods inherited from class org.apache.olingo.commons.api.data.Annotatable

    getAnnotations

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Valuable

      public Valuable()
  • Method Details

    • isNull

      public boolean isNull()
      Check if according value is null.
      Returns:
      true if value is null, otherwise false
    • getType

      public String getType()
      Get string representation of type (can be null if not set).
      Returns:
      string representation of type (can be null if not set)
    • setType

      public void setType(String type)
      Set string representation of type.
      Parameters:
      type - string representation of type
    • isPrimitive

      public boolean isPrimitive()
      Check if Valuable contains a PRIMITIVE or COLLECTION_PRIMITIVE ValueType
      Returns:
      true if ValueType is a PRIMITIVE or COLLECTION_PRIMITIVE, otherwise false
    • isGeospatial

      public boolean isGeospatial()
      Check if Valuable contains a GEOSPATIAL or COLLECTION_GEOSPATIAL ValueType
      Returns:
      true if ValueType is a GEOSPATIAL or COLLECTION_GEOSPATIAL, otherwise false
    • isEnum

      public boolean isEnum()
      Check if Valuable contains a ENUM or COLLECTION_ENUM ValueType
      Returns:
      true if ValueType is a ENUM or COLLECTION_ENUM, otherwise false
    • isComplex

      public boolean isComplex()
      Check if Valuable contains a COMPLEX or COLLECTION_COMPLEX ValueType
      Returns:
      true if ValueType is a COMPLEX or COLLECTION_COMPLEX, otherwise false
    • isCollection

      public boolean isCollection()
      Check if Valuable contains a COLLECTION_* ValueType
      Returns:
      true if ValueType is a COLLECTION_*, otherwise false
    • asPrimitive

      public Object asPrimitive()
      Get the value in its primitive representation or null if it is not based on a primitive ValueType
      Returns:
      primitive representation or null if it is not based on a primitive ValueType
    • asGeospatial

      public Geospatial asGeospatial()
      Get the value in its geospatial representation or null if it is not based on a geospatial ValueType
      Returns:
      geospatial representation or null if it is not based on a geospatial ValueType
    • asEnum

      public Object asEnum()
      Get the value in its enum representation or null if it is not based on a enum ValueType
      Returns:
      enum representation or null if it is not based on a enum ValueType
    • asComplex

      public ComplexValue asComplex()
      Get the value in its complex representation or null if it is not based on a complex ValueType
      Returns:
      primitive complex or null if it is not based on a complex ValueType
    • asCollection

      public List<?> asCollection()
      Get the value as collection or null if it is not a collection ValueType
      Returns:
      collection or null if it is not a collection ValueType
    • getValue

      public Object getValue()
      Get the value
      Returns:
      the value
    • setValue

      public void setValue(ValueType valueType, Object value)
      Set value and value type.
      Parameters:
      valueType - value type
      value - value
    • getValueType

      public ValueType getValueType()
      Get value type for this valuable.
      Returns:
      value type for this valuable
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object