public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType
kind, typeNameedmEDM_NAMESPACE| Constructor and Description |
|---|
EdmEnumTypeImpl(Edm edm,
FullQualifiedName enumName,
CsdlEnumType enumType) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
fromUriLiteral(String literal)
Converts URI literal representation to default literal representation.
|
Class<?> |
getDefaultType()
Returns the default Java type for this EDM primitive type as described in the documentation of
EdmPrimitiveType. |
EdmMember |
getMember(String name)
Get member according to given name
|
List<String> |
getMemberNames() |
EdmPrimitiveType |
getUnderlyingType() |
int |
hashCode() |
boolean |
isCompatible(EdmPrimitiveType primitiveType)
Checks type compatibility.
|
boolean |
isFlags() |
String |
toUriLiteral(String literal)
Converts default literal representation to URI literal representation.
|
boolean |
validate(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode)
Validates literal value.
|
<T> T |
valueOfString(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode,
Class<T> returnType)
Converts literal representation of value to system data type.
|
String |
valueToString(Object value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode)
Converts system data type to literal representation of value.
|
getFullQualifiedName, getKind, getNamespacegetName, toStringgetAnnotation, getAnnotationsclone, finalize, getClass, notify, notifyAll, wait, wait, waitvalidateDecimalsgetFullQualifiedName, getKind, getNamespacepublic EdmEnumTypeImpl(Edm edm, FullQualifiedName enumName, CsdlEnumType enumType)
public EdmPrimitiveType getUnderlyingType()
getUnderlyingType in interface EdmEnumTypeEdmPrimitiveType this EdmEnumType is based uponpublic EdmMember getMember(String name)
EdmEnumTypegetMember in interface EdmEnumTypename - name of memberEdmMember for the given namepublic List<String> getMemberNames()
getMemberNames in interface EdmEnumTypepublic boolean isCompatible(EdmPrimitiveType primitiveType)
EdmPrimitiveTypeisCompatible in interface EdmPrimitiveTypeprimitiveType - the EdmPrimitiveType to be tested for compatibilitytrue if the provided type is compatible to this typepublic Class<?> getDefaultType()
EdmPrimitiveTypeEdmPrimitiveType.getDefaultType in interface EdmPrimitiveTypepublic boolean validate(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode)
EdmPrimitiveTypevalidate in interface EdmPrimitiveTypevalue - the literal valueisNullable - whether the null value is allowedmaxLength - the maximum lengthprecision - the precisionscale - the scaleisUnicode - whether non-ASCII characters are allowed (relevant only for Edm.String)true if the validation is successfulpublic <T> T valueOfString(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode, Class<T> returnType) throws EdmPrimitiveTypeException
EdmPrimitiveTypevalueOfString in interface EdmPrimitiveTypevalue - the literal representation of valueisNullable - whether the null value 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 of
EdmPrimitiveTypereturnType indicatesEdmPrimitiveTypeExceptionpublic String valueToString(Object value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveType
Returns null if value is null and null is an allowed value.
valueToString in interface EdmPrimitiveTypevalue - the Java value as Object; its type must be one of the list in the documentation of
EdmPrimitiveTypeisNullable - whether the null value is allowedmaxLength - the maximum lengthprecision - the precisionscale - the scaleisUnicode - whether non-ASCII characters are allowed (relevant only for Edm.String)EdmPrimitiveTypeExceptionpublic String toUriLiteral(String literal)
EdmPrimitiveType
Returns null if the literal is null. Does not perform any validation.
toUriLiteral in interface EdmPrimitiveTypeliteral - the literal in default representationpublic String fromUriLiteral(String literal) throws EdmPrimitiveTypeException
EdmPrimitiveType
Returns null if the literal is null. Checks the presence of a required prefix and of
required surrounding quotation marks but does not perform any further validation.
fromUriLiteral in interface EdmPrimitiveTypeliteral - the literal in URI representationEdmPrimitiveTypeException - if a required prefix or required surrounding quotation marks are missingpublic boolean isFlags()
isFlags in interface EdmEnumTypeCopyright © 2023. All rights reserved.