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
Defines a value with an according type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<?>
Get the value as collection or null if it is not a collection ValueTypeGet the value in its complex representation or null if it is not based on a complex ValueTypeasEnum()
Get the value in its enum representation or null if it is not based on a enum ValueTypeGet the value in its geospatial representation or null if it is not based on a geospatial ValueTypeGet the value in its primitive representation or null if it is not based on a primitive ValueTypeboolean
getType()
Get string representation of type (can be null if not set).getValue()
Get the valueGet value type for this valuable.int
hashCode()
boolean
Check if Valuable contains a COLLECTION_* ValueTypeboolean
Check if Valuable contains a COMPLEX or COLLECTION_COMPLEX ValueTypeboolean
isEnum()
Check if Valuable contains a ENUM or COLLECTION_ENUM ValueTypeboolean
Check if Valuable contains a GEOSPATIAL or COLLECTION_GEOSPATIAL ValueTypeboolean
isNull()
Check if according value isnull
.boolean
Check if Valuable contains a PRIMITIVE or COLLECTION_PRIMITIVE ValueTypevoid
Set string representation of type.void
Set value and value type.toString()
Methods inherited from class org.apache.olingo.commons.api.data.Annotatable
getAnnotations
-
Constructor Details
-
Valuable
public Valuable()
-
-
Method Details
-
isNull
public boolean isNull()Check if according value isnull
.- Returns:
true
if value isnull
, otherwisefalse
-
getType
Get string representation of type (can be null if not set).- Returns:
- string representation of type (can be null if not set)
-
setType
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
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
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
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
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
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
Get the value- Returns:
- the value
-
setValue
Set value and value type.- Parameters:
valueType
- value typevalue
- value
-
getValueType
Get value type for this valuable.- Returns:
- value type for this valuable
-
equals
-
hashCode
public int hashCode() -
toString
-