Class ExpectedRequestParameter

java.lang.Object
com.pixelservices.flash.components.http.expected.ExpectedRequestParameter

public class ExpectedRequestParameter extends Object
The ExpectedRequestParameter lets you assume the existence of a parameter in the request and work with it
  • Constructor Details

    • ExpectedRequestParameter

      public ExpectedRequestParameter(String parameterName, RequestHandler requestHandler)
      Constructor for ExpectedRequestParameter
      Parameters:
      parameterName - The name of the parameter to be retrieved from the request
      requestHandler - The RequestHandler object
    • ExpectedRequestParameter

      public ExpectedRequestParameter(String parameterName, String description, RequestHandler requestHandler)
      Constructor for ExpectedRequestParameter
      Parameters:
      parameterName - The name of the parameter to be retrieved from the request
      requestHandler - The RequestHandler object
  • Method Details

    • getFieldValue

      public Object getFieldValue()
      Get the field value. If the parameter has multiple values, return the first by default. To retrieve all values, use getFieldValues().
      Returns:
      The field value (first value if multiple exist).
    • getString

      public String getString()
      Get the field value as a String
      Returns:
      The field value as a String
    • getInt

      public Integer getInt()
      Get the field value as an Integer
      Returns:
      The field value as an Integer
    • getBoolean

      public Boolean getBoolean()
      Get the field value as a Boolean
      Returns:
      The field value as a Boolean
    • getLong

      public Long getLong()
      Get the field value as a Long
      Returns:
      The field value as a Long
    • getDouble

      public Double getDouble()
      Get the field value as a Double
      Returns:
      The field value as a Double
    • getFloat

      public Float getFloat()
      Get the field value as a Float
      Returns:
      The field value as a Float
    • getByte

      public Byte getByte()
      Get the field value as a Byte
      Returns:
      The field value as a Byte
    • getShort

      public Short getShort()
      Get the field value as a Short
      Returns:
      The field value as a Short
    • getChar

      public char getChar()
      Get the field value as a Character
      Returns:
      The field value as a Character
    • getJSONObject

      public org.json.JSONObject getJSONObject()
      Get the field value as a JSONObject
      Returns:
      The field value as a JSONObject
    • getDescription

      public String getDescription()
      Get description of the field
      Returns:
      The description of the field