Class EdmEnumTypeImpl
java.lang.Object
org.apache.olingo.commons.core.edm.AbstractEdmAnnotatable
org.apache.olingo.commons.core.edm.AbstractEdmNamed
org.apache.olingo.commons.core.edm.EdmTypeImpl
org.apache.olingo.commons.core.edm.EdmEnumTypeImpl
- All Implemented Interfaces:
EdmAnnotatable,EdmEnumType,EdmNamed,EdmPrimitiveType,EdmType
-
Field Summary
Fields inherited from class org.apache.olingo.commons.core.edm.EdmTypeImpl
kind, typeNameFields inherited from class org.apache.olingo.commons.core.edm.AbstractEdmAnnotatable
edmFields inherited from interface org.apache.olingo.commons.api.edm.EdmPrimitiveType
EDM_NAMESPACE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfromUriLiteral(String literal) Converts URI literal representation to default literal representation.Class<?>Returns the default Java type for this EDM primitive type as described in the documentation ofEdmPrimitiveType.Get member according to given nameinthashCode()booleanisCompatible(EdmPrimitiveType primitiveType) Checks type compatibility.booleanisFlags()toUriLiteral(String literal) Converts default literal representation to URI literal representation.booleanvalidate(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) Validates literal value.<T> TvalueOfString(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode, Class<T> returnType) Converts literal representation of value to system data type.valueToString(Object value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) Converts system data type to literal representation of value.Methods inherited from class org.apache.olingo.commons.core.edm.EdmTypeImpl
getFullQualifiedName, getKind, getNamespaceMethods inherited from class org.apache.olingo.commons.core.edm.AbstractEdmNamed
getName, toStringMethods inherited from class org.apache.olingo.commons.core.edm.AbstractEdmAnnotatable
getAnnotation, getAnnotationsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.olingo.commons.api.edm.EdmPrimitiveType
validateDecimalsMethods inherited from interface org.apache.olingo.commons.api.edm.EdmType
getFullQualifiedName, getKind, getNamespace
-
Constructor Details
-
EdmEnumTypeImpl
-
-
Method Details
-
getUnderlyingType
- Specified by:
getUnderlyingTypein interfaceEdmEnumType- Returns:
- the
EdmPrimitiveTypethisEdmEnumTypeis based upon
-
getMember
Description copied from interface:EdmEnumTypeGet member according to given name- Specified by:
getMemberin interfaceEdmEnumType- Parameters:
name- name of member- Returns:
EdmMemberfor the given name
-
getMemberNames
- Specified by:
getMemberNamesin interfaceEdmEnumType- Returns:
- member names as a list
-
isCompatible
Description copied from interface:EdmPrimitiveTypeChecks type compatibility.- Specified by:
isCompatiblein interfaceEdmPrimitiveType- Parameters:
primitiveType- theEdmPrimitiveTypeto be tested for compatibility- Returns:
trueif the provided type is compatible to this type
-
getDefaultType
Description copied from interface:EdmPrimitiveTypeReturns the default Java type for this EDM primitive type as described in the documentation ofEdmPrimitiveType.- Specified by:
getDefaultTypein interfaceEdmPrimitiveType- Returns:
- the default Java type
-
validate
public boolean validate(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) Description copied from interface:EdmPrimitiveTypeValidates literal value.- Specified by:
validatein interfaceEdmPrimitiveType- Parameters:
value- the literal valueisNullable- whether thenullvalue is allowedmaxLength- the maximum lengthprecision- the precisionscale- the scaleisUnicode- whether non-ASCII characters are allowed (relevant only for Edm.String)- Returns:
trueif the validation is successful
-
valueOfString
public <T> T valueOfString(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode, Class<T> returnType) throws EdmPrimitiveTypeException Description copied from interface:EdmPrimitiveTypeConverts literal representation of value to system data type.- Specified by:
valueOfStringin interfaceEdmPrimitiveType- Parameters:
value- the literal representation of valueisNullable- whether thenullvalue is allowedmaxLength- the maximum lengthprecision- the precisionscale- the scaleisUnicode- whether non-ASCII characters are allowed (relevant only for Edm.String)returnType- the class of the returned value; it must be one of the list in the documentation ofEdmPrimitiveType- Returns:
- the value as an instance of the class the parameter
returnTypeindicates - Throws:
EdmPrimitiveTypeException
-
valueToString
public String valueToString(Object value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException Description copied from interface:EdmPrimitiveTypeConverts system data type to literal representation of value.Returns
nullif value isnullandnullis an allowed value.- Specified by:
valueToStringin interfaceEdmPrimitiveType- Parameters:
value- the Java value as Object; its type must be one of the list in the documentation ofEdmPrimitiveTypeisNullable- whether thenullvalue is allowedmaxLength- the maximum lengthprecision- the precisionscale- the scaleisUnicode- whether non-ASCII characters are allowed (relevant only for Edm.String)- Returns:
- literal representation as String
- Throws:
EdmPrimitiveTypeException
-
toUriLiteral
Description copied from interface:EdmPrimitiveTypeConverts default literal representation to URI literal representation.Returns
nullif the literal isnull. Does not perform any validation.- Specified by:
toUriLiteralin interfaceEdmPrimitiveType- Parameters:
literal- the literal in default representation- Returns:
- URI literal representation as String
-
fromUriLiteral
Description copied from interface:EdmPrimitiveTypeConverts URI literal representation to default literal representation.Returns
nullif the literal isnull. Checks the presence of a required prefix and of required surrounding quotation marks but does not perform any further validation.- Specified by:
fromUriLiteralin interfaceEdmPrimitiveType- Parameters:
literal- the literal in URI representation- Returns:
- default literal representation as String
- Throws:
EdmPrimitiveTypeException- if a required prefix or required surrounding quotation marks are missing
-
isFlags
public boolean isFlags()- Specified by:
isFlagsin interfaceEdmEnumType- Returns:
- true if flags is set
-
hashCode
public int hashCode() -
equals
-