@Beta public class ParameterWrapper extends Object
Usually parameters of Builder objects are wrapped
Please note that support of all types and validation is not complete yet.
Please note that this class is marked with Beta annotation, so it can be subject of incompatible changes
or removal in later releases.
| Modifier and Type | Class and Description |
|---|---|
static class |
ParameterWrapper.ParameterType
Wrapped parameter types.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAPIFieldName()
API field name.
|
boolean |
getBooleanValue()
Value of a boolean field.
|
Object |
getCurrentValue()
Current value.
|
String |
getDetailedDescription()
Detailed description.
|
double |
getDoubleValue()
Value of a double field.
|
Enum |
getEnumValue()
Value of an enum field.
|
int |
getIntValue()
Value of an int field.
|
String |
getName()
Name.
|
Class<?> |
getParameterClass()
Return enum class for enum field.
|
String |
getShortName()
Short name.
|
String |
getStringValue()
Value of a String field.
|
ParameterWrapper.ParameterType |
getType()
Type.
|
boolean |
isDoubleValid(double d)
Check if a value for a double field is valid.
|
void |
parseParameterValue(String value)
Parse parameter value from a String.
|
void |
setBooleanValue(boolean b)
Set value of a boolean field.
|
void |
setDoubleValue(double d)
Set value of a double field.
|
void |
setIntValue(int i)
Set int value of a int field.
|
void |
setStringValue(String s)
Set String value of a String field.
|
void |
setValue(Object o)
Set value.
|
String |
toStringRepresentation()
Create String representation of the represented value.
|
public String getAPIFieldName()
public String getShortName()
public String getName()
public String getDetailedDescription()
public Object getCurrentValue()
public void setValue(Object o)
o - Value to set. Type must match represented parameter type. Note that setting null is not
allowed.public ParameterWrapper.ParameterType getType()
public String toStringRepresentation()
Note that this method uses Enum.name() instead of its Object.toString() since later
can be overridden preventing further safe parse.
Note that ParameterWrapper.ParameterType.OTHER type parameters are currently not supported.
parseParameterValue(java.lang.String)UnsupportedOperationException - when represented parameter type is ParameterWrapper.ParameterType.OTHERpublic void parseParameterValue(String value)
value - String value. Note that null values are not allowed.IllegalArgumentException - when parse failedUnsupportedOperationException - when represented parameter type is ParameterWrapper.ParameterType.OTHERpublic int getIntValue()
UnsupportedOperationException - when the associated parameters type is differentpublic void setIntValue(int i)
i - Value to be setUnsupportedOperationException - when the associated parameters type is differentpublic double getDoubleValue()
UnsupportedOperationException - when the associated parameters type is differentpublic void setDoubleValue(double d)
d - Value to be setUnsupportedOperationException - when the associated parameters type is differentpublic boolean isDoubleValid(double d)
d - ValueUnsupportedOperationException - when the associated parameters type is differentpublic String getStringValue()
UnsupportedOperationException - when the associated parameters type is differentpublic void setStringValue(String s)
s - Value to be setUnsupportedOperationException - when the associated parameters type is differentpublic boolean getBooleanValue()
UnsupportedOperationException - when the associated parameters type is differentpublic void setBooleanValue(boolean b)
b - Value to be setUnsupportedOperationException - when the associated parameters type is differentpublic Class<?> getParameterClass()
public Enum getEnumValue()
UnsupportedOperationException - when the associated parameters type is different