public class Parameter
extends java.lang.Object
Encapsulates an OData parameter.
Modifier and Type | Field and Description |
---|---|
static int |
MODE_IN
Constant parameter mode for 'In' mode parameters.
|
static int |
MODE_IN_OUT
Constant parameter mode for 'InOut' mode parameters.
|
static int |
MODE_OUT
Constant parameter mode for 'Out' mode parameters.
|
Constructor and Description |
---|
Parameter() |
Modifier and Type | Method and Description |
---|---|
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 |
getFixedLength()
Return
true if this item has fixed length for string and binary values. |
int |
getMaxLength()
Return maximum length for
string and binary values. |
int |
getMinLength()
Return minimum length for
string and binary values. |
int |
getMode()
Return mode of the parameter.
|
java.lang.String |
getName()
Return name of the parameter.
|
int |
getPrecision()
Return precision for
decimal and integer values. |
int |
getScale()
Return scale for
decimal values. |
int |
getSourceLine()
Return source line number for this schema element within its defining schema.
|
int |
getSrid()
Return EPSG Spatial Reference System Identifier (SRID) for the associated value.
|
DataType |
getType()
Return type of the parameter.
|
DataValue |
getValue()
Return (nullable) Value of the parameter.
|
boolean |
isNullable()
Return
true if this item is nullable. |
boolean |
isUnicode()
Return
true if this item allows Unicode content. |
void |
setMaxLength(int value)
Set maximum length for
string and binary values. |
void |
setMinLength(int value)
Set minimum length for
string and binary values. |
void |
setMode(int value)
Set mode of the parameter.
|
void |
setName(java.lang.String value)
Set name of the parameter.
|
void |
setNullable(boolean value)
Set
true if this item is nullable. |
void |
setPrecision(int value)
Set precision for
decimal and integer values. |
void |
setScale(int value)
Set scale for
decimal values. |
void |
setSourceLine(int value)
Set source line number for this schema element within its defining schema.
|
void |
setSrid(int value)
Set EPSG Spatial Reference System Identifier (SRID) for the associated value.
|
void |
setType(DataType value)
Set type of the parameter.
|
void |
setUnicode(boolean value)
Set
true if this item allows Unicode content. |
void |
setValue(DataValue value)
Set value of the parameter.
|
java.lang.String |
toString() |
public static final int MODE_IN
Constant parameter mode for 'In' mode parameters.
public static final int MODE_OUT
Constant parameter mode for 'Out' mode parameters.
public static final int MODE_IN_OUT
Constant parameter mode for 'InOut' mode parameters.
public Annotation getAnnotation(java.lang.String term)
Lookup an existing annotation by term name, or throw an exception if the annotation is not found.
Parameter.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 getFixedLength()
Return true
if this item has fixed length for string
and binary
values.
public int getMaxLength()
Return maximum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
public int getMinLength()
Return minimum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
public int getMode()
Return mode of the parameter.
public java.lang.String getName()
Return name of the parameter.
public int getPrecision()
Return precision for decimal
and integer
values.
TypeFacets.ANY_PRECISION.
public int getScale()
Return scale for decimal
values.
TypeFacets.FLOATING_SCALE, TypeFacets.VARIABLE_SCALE.
public int getSourceLine()
Return source line number for this schema element within its defining schema.
public int getSrid()
Return EPSG Spatial Reference System Identifier (SRID) for the associated value.
TypeFacets.VARIABLE_SRID.
public DataType getType()
Return type of the parameter.
public DataValue getValue()
Return (nullable) Value of the parameter.
DataMethod.parameters
(formal), DataMethodCall.parameters
(actual).
public boolean isNullable()
Return true
if this item is nullable.
true
if this item is nullable.public boolean isUnicode()
Return true
if this item allows Unicode content.
If isUnicode
is false
, then this item only allows ASCII content.
true
if this item allows Unicode content.public void setMaxLength(int value)
Set maximum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
value
- Maximum length for `string` and `binary` values.public void setMinLength(int value)
Set minimum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
value
- Minimum length for `string` and `binary` values.public void setMode(int value)
Set mode of the parameter.
value
- Mode of the parameter.public void setName(java.lang.String value)
Set name of the parameter.
value
- Name of the parameter.public void setNullable(boolean value)
Set true
if this item is nullable.
value
- true
if this item is nullable.public void setPrecision(int value)
Set precision for decimal
and integer
values.
TypeFacets.ANY_PRECISION.
value
- Precision for `decimal` and `integer` values.public void setScale(int value)
Set scale for decimal
values.
TypeFacets.FLOATING_SCALE, TypeFacets.VARIABLE_SCALE.
value
- Scale for `decimal` values.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 void setSrid(int value)
Set EPSG Spatial Reference System Identifier (SRID) for the associated value.
TypeFacets.VARIABLE_SRID.
value
- [EPSG](http://www.epsg.org/Geodetic.html) Spatial Reference System Identifier (SRID) for the associated value.public void setType(DataType value)
Set type of the parameter.
value
- Type of the parameter.public void setUnicode(boolean value)
Set true
if this item allows Unicode content.
If isUnicode
is false
, then this item only allows ASCII content.
value
- true
if this item allows Unicode content.public void setValue(DataValue value)
Set value of the parameter.
DataMethod.parameters
(formal), DataMethodCall.parameters
(actual).
value
- Value of the parameter.public java.lang.String toString()
toString
in class java.lang.Object