Class RequestFieldBoolean

java.lang.Object
com.helger.web.scope.util.AbstractRequestFieldData
com.helger.web.scope.util.RequestFieldData
com.helger.photon.core.form.RequestField
com.helger.photon.core.form.RequestFieldBoolean
All Implemented Interfaces:
com.helger.html.request.IHCBaseRequestField, com.helger.html.request.IHCRequestField, com.helger.html.request.IHCRequestFieldBoolean

public class RequestFieldBoolean extends RequestField implements com.helger.html.request.IHCRequestFieldBoolean
Special request field specially for check boxes with a fixed value.
Author:
Philip Helger
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RequestFieldBoolean(String sFieldName, boolean bDefaultValue)
    Constructor using either VALUE_CHECKED or VALUE_UNCHECKED.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    static String
    getStringValue(boolean bValue)
     
    int
     
    boolean
     
    boolean
    isChecked(com.helger.web.scope.IRequestParamContainer aParams)
     
     

    Methods inherited from class com.helger.web.scope.util.RequestFieldData

    getDefaultValue, getRequestValue, getRequestValueWithoutDefault, hasRequestValue

    Methods inherited from class com.helger.web.scope.util.AbstractRequestFieldData

    getFieldName, getParams

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.helger.html.request.IHCBaseRequestField

    getFieldName

    Methods inherited from interface com.helger.html.request.IHCRequestField

    getDefaultValue, getRequestValue
  • Field Details

    • VALUE_CHECKED

      public static final String VALUE_CHECKED
    • VALUE_UNCHECKED

      public static final String VALUE_UNCHECKED
  • Constructor Details

    • RequestFieldBoolean

      public RequestFieldBoolean(@Nonnull @Nonempty String sFieldName, boolean bDefaultValue)
      Constructor using either VALUE_CHECKED or VALUE_UNCHECKED.
      Parameters:
      sFieldName - Name of the field.
      bDefaultValue - The status to be returned, if no request value is present.
  • Method Details

    • getStringValue

      @Nonnull @Nonempty public static String getStringValue(boolean bValue)
      Parameters:
      bValue - the boolean value
      Returns:
      The string parameter value to be used for the passed parameter. Neither null nor empty.
    • isChecked

      public boolean isChecked(@Nonnull com.helger.web.scope.IRequestParamContainer aParams)
    • isChecked

      public boolean isChecked()
      Specified by:
      isChecked in interface com.helger.html.request.IHCRequestFieldBoolean
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class com.helger.web.scope.util.RequestFieldData
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.helger.web.scope.util.RequestFieldData
    • toString

      public String toString()
      Overrides:
      toString in class com.helger.web.scope.util.RequestFieldData