Class Field

    • Constructor Detail

      • Field

        public Field()
      • Field

        public Field​(String name,
                     String value)
        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

        public Field​(String name,
                     String label,
                     String value)
        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 Detail

      • getName

        public String 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

        public String 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

        public 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

        public void setLabel​(String label)
      • getValueAsInt

        public int getValueAsInt()
        This method attempts to coerce an int value from the underlying String value. If the coercion fails for any reason DEFAULT_NUM_VAL is 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 reason DEFAULT_NUM_VAL is 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 reason DEFAULT_NUM_VAL is 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 reason DEFAULT_NUM_VAL is 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:
        UploadFileFieldDescriptor
      • getFileValueAsString

        public String 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:
        UploadFileFieldDescriptor