Constructor and Description |
---|
EnumValue(long num,
java.lang.String str,
EnumType type)
For internal use only.
|
Modifier and Type | Method and Description |
---|---|
byte |
byteValue()
Return the numeric value of this enum value as a byte.
|
static EnumValue |
castOptional(DataValue value)
For internal use only.
|
static EnumValue |
castRequired(DataValue value)
For internal use only.
|
static int |
compare(EnumValue x,
EnumValue y)
Compare two wrapped values for ordering.
|
static boolean |
equal(EnumValue x,
EnumValue y)
Compare two wrapped values for equality.
|
Annotation |
getAnnotation(java.lang.String term)
Lookup an existing annotation by term name, or throw an exception if the annotation is not found.
|
AnnotationMap |
getAnnotations()
Return map of annotations for this model element.
|
boolean |
getCanBeRemoved()
Return can this model element be removed by
DataService.refreshMetadata . |
DataType |
getDataType()
Return data type with a
DataType.code of DataType.ENUM_VALUE. |
EnumType |
getEnumType()
Return the enum type metadata for this value (
EnumValue.dataType cast to EnumType ). |
java.lang.String |
getName()
Return name of this enumeration member.
|
int |
getSourceLine()
Return source line number for this schema element within its defining schema.
|
DataValue |
getValue()
Return the numeric value of this enum value as a ByteValue, ShortValue, IntValue, LongValue, UnsignedByte or UnsignedShort (depending on the enum type's underlying type).
|
int |
intValue()
Return the numeric value of this enum value as an int.
|
boolean |
isExtension()
Return true if this member was added since metadata was originally loaded.
|
boolean |
isRemoved()
Return has this model element been removed by a successful call to
DataService.refreshMetadata ?
If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element,
and that the new metadata (after refreshMetadata was called) does not include this model element. |
long |
longValue()
Return the numeric value of this enum value as a long.
|
void |
setCanBeRemoved(boolean value)
Set can this model element be removed by
DataService.refreshMetadata . |
void |
setExtension(boolean value)
Set true if this member was added since metadata was originally loaded.
|
void |
setRemoved(boolean value)
Set has this model element been removed by a successful call to
DataService.refreshMetadata ?
If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element,
and that the new metadata (after refreshMetadata was called) does not include this model element. |
void |
setSourceLine(int value)
Set source line number for this schema element within its defining schema.
|
short |
shortValue()
Return the numeric value of this enum value as a short.
|
java.lang.String |
toString()
Convert this data value to a string.
|
cloneMutable, equals, getTypeCode, hashCode
public EnumValue(long num, java.lang.String str, EnumType type)
For internal use only.
num
- (internal use only)str
- (internal use only)type
- (internal use only)public byte byteValue()
Return the numeric value of this enum value as a byte.
public static EnumValue castOptional(DataValue value)
For internal use only.
value
- (internal use only)public static EnumValue castRequired(DataValue value)
For internal use only.
value
- (internal use only)public static int compare(EnumValue x, EnumValue y)
Compare two wrapped values for ordering.
x
- First object for comparison.y
- Second object for comparison.x.value < y.value
, 0 if x.value == y.value
, or 1 if x.value > y.value
.public static boolean equal(EnumValue x, EnumValue y)
Compare two wrapped values for equality.
x
- (nullable) First object for comparison.y
- (nullable) Second object for comparison.true
if x.value == y.value
or if both arguments are null
, otherwise false
.public Annotation getAnnotation(java.lang.String term)
Lookup an existing annotation by term name, or throw an exception if the annotation is not found.
EnumValue.annotations
and AnnotationMap.get
, for looking up annotations that might not exist.
term
- The term name.public AnnotationMap getAnnotations()
Return map of annotations for this model element. For annotations without qualifiers, the entry key is the annotation term name. For annotations with qualifiers, the entry key is the annotation term name, then "#", then the annotation qualifier.
public boolean getCanBeRemoved()
Return can this model element be removed by DataService.refreshMetadata
. Defaults to false
.
Set this to true
to indicate that the application is coded to be able able to function correctly without this model element.
public DataType getDataType()
Return data type with a DataType.code
of DataType.ENUM_VALUE.
getDataType
in class DataValue
DataType.code
of DataType.ENUM_VALUE.public EnumType getEnumType()
Return the enum type metadata for this value (EnumValue.dataType
cast to EnumType
).
EnumValue.dataType
cast to EnumType
).public java.lang.String getName()
Return name of this enumeration member.
public int getSourceLine()
Return source line number for this schema element within its defining schema.
public DataValue getValue()
Return the numeric value of this enum value as a ByteValue, ShortValue, IntValue, LongValue, UnsignedByte or UnsignedShort (depending on the enum type's underlying type).
public int intValue()
Return the numeric value of this enum value as an int.
public boolean isExtension()
Return true if this member was added since metadata was originally loaded.
public boolean isRemoved()
Return has this model element been removed by a successful call to DataService.refreshMetadata
?
If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element,
and that the new metadata (after refreshMetadata was called) does not include this model element.
public long longValue()
Return the numeric value of this enum value as a long.
public void setCanBeRemoved(boolean value)
Set can this model element be removed by DataService.refreshMetadata
. Defaults to false
.
Set this to true
to indicate that the application is coded to be able able to function correctly without this model element.
value
- Can this model element be removed by `DataService.refreshMetadata`. Defaults to `false`.public void setExtension(boolean value)
Set true if this member was added since metadata was originally loaded.
value
- True if this member was added since metadata was originally loaded.public void setRemoved(boolean value)
Set has this model element been removed by a successful call to DataService.refreshMetadata
?
If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element,
and that the new metadata (after refreshMetadata was called) does not include this model element.
value
- Has this model element been removed by a successful call to `DataService.refreshMetadata`?public void setSourceLine(int value)
Set source line number for this schema element within its defining schema.
value
- Source line number for this schema element within its defining schema.public short shortValue()
Return the numeric value of this enum value as a short.
public java.lang.String toString()
Convert this data value to a string.
If the EnumValue.dataType
is defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used.
JSON format is used for structured values (arrays and objects).