Package org.sourceid.saml20.adapter.conf
Class Field
java.lang.Object
org.sourceid.saml20.adapter.conf.Field
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
HashedField
This class holds the name and user-entered value of a GUI-rendered configuration field.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]If the field type is an UploadFileFieldDescriptor and the file uploaded is binary, this method will return the bytes of the file.If the field type is an UploadFileFieldDescriptor and the file uploaded is text, this method will return that text.getLabel()Gets the label of this field.getName()Gets the name of this field.getValue()Gets the value of this field.booleanThis method coerces an boolean value from the underlying String value.doubleThis method attempts to coerce a double value from the underlying String value.floatThis method attempts to coerce a float value from the underlying String value.intThis method attempts to coerce an int value from the underlying String value.longThis method attempts to coerce a long value from the underlying String value.voidtoString()
-
Field Details
-
DEFAULT_NUM_VAL
public static final int DEFAULT_NUM_VAL- See Also:
-
-
Constructor Details
-
Field
public Field() -
Field
Create a new Field with the specified name and value. The name of the field is the same name as the name of FieldDescriptor that was used to render the field on the GUI. The value will be the value entered by the admin/user in the GUI.- Parameters:
name-value-
-
Field
Create a new Field with the specified name, label and value.- Parameters:
name- The name of the field is the same name as the name of FieldDescriptor that was used to render the field on the GUI.label- The label of the field is the same label as the label of FieldDescriptor that was used to render the field on the GUI.value- The value entered by the admin/user in the GUI.
-
-
Method Details
-
getName
Gets the name of this field. The name of the field is the same name as the name of FieldDescriptor that was used to render the field on the GUI.- Returns:
- the name
-
getValue
Gets the value of this field. The value will be the value entered by the admin/user in the GUI.- Returns:
- the value which may be null or an empty string.
-
getLabel
Gets the label of this field. If the label of FieldDescriptor that was used to render the field on the GUI exists, the label of the field will be the same label as the label of the FieldDescriptor. Otherwise, the label of the field will be the same as the name of the field.- Returns:
- the label
-
setLabel
-
getValueAsInt
public int getValueAsInt()This method attempts to coerce an int value from the underlying String value. If the coercion fails for any reasonDEFAULT_NUM_VALis returned.- Returns:
- the value as an int.
-
getValueAsLong
public long getValueAsLong()This method attempts to coerce a long value from the underlying String value. If the coercion fails for any reasonDEFAULT_NUM_VALis returned.- Returns:
- the value as a long.
-
getValueAsFloat
public float getValueAsFloat()This method attempts to coerce a float value from the underlying String value. If the coercion fails for any reasonDEFAULT_NUM_VALis returned.- Returns:
- the value as a float.
-
getValueAsDouble
public double getValueAsDouble()This method attempts to coerce a double value from the underlying String value. If the coercion fails for any reasonDEFAULT_NUM_VALis returned.- Returns:
- the value as a double.
-
getValueAsBoolean
public boolean getValueAsBoolean()This method coerces an boolean value from the underlying String value.- Returns:
- true if the underlying String value is not null and is equal, ignoring case, to the string "true".
-
getFileValueAsByteArray
public byte[] getFileValueAsByteArray()If the field type is an UploadFileFieldDescriptor and the file uploaded is binary, this method will return the bytes of the file.- Returns:
- a byte array with the content of the uploaded file.
- See Also:
-
getFileValueAsString
If the field type is an UploadFileFieldDescriptor and the file uploaded is text, this method will return that text.- Returns:
- the text value of the uploaded file.
- See Also:
-
toString
-