Interface HttpParameter

All Superinterfaces:
CharSequence
All Known Implementing Classes:
DefaultHttpParam

public interface HttpParameter extends CharSequence
An interface for bulding HTML parameters by an Enumerator.

Usage

 {
    String value = Param.text(ServletRequest, "my default value");
 }
 enum Param implements HttpParam {
     REGEXP,
     TEXT;
Author:
Pavel Ponec
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    An empty text value
  • Method Summary

    Modifier and Type
    Method
    Description
    default @NotNull String
    buildParameterName(@Nullable String name)
    Build a default non-null parameter name.
    default @NotNull String
    Returns a non-null default text value.
    default char
    charAt(int index)
     
    default int
     
    of(@NotNull String name)
    Create a default implementation
    of(@NotNull String name, @NotNull String defaultValue)
    Create a default implementation
    default @NotNull String
    of(@NotNull HttpContext context)
    Default value is an empty String
    default boolean
    of(@NotNull HttpContext context, @org.jetbrains.annotations.Nullable boolean defaultValue)
    Returns a parameter of the request or the default value
    default double
    of(@NotNull HttpContext context, @org.jetbrains.annotations.Nullable double defaultValue)
    Returns a parameter of the request or the default value
    default float
    of(@NotNull HttpContext context, @org.jetbrains.annotations.Nullable float defaultValue)
    Returns a parameter of the request or the default value
    default char
    of(@NotNull HttpContext context, @org.jetbrains.annotations.Nullable char defaultValue)
    Returns a parameter of the request or the default value
    default int
    of(@NotNull HttpContext context, @org.jetbrains.annotations.Nullable int defaultValue)
    Returns a parameter of the request or the default value
    default long
    of(@NotNull HttpContext context, @org.jetbrains.annotations.Nullable long defaultValue)
    Returns a parameter of the request or the default value
    default short
    of(@NotNull HttpContext context, @org.jetbrains.annotations.Nullable short defaultValue)
    Returns a parameter of the request or the default value
    default <V extends Enum<V>>
    V
    of(@NotNull HttpContext context, @NotNull Class<V> clazz)
    Returns a parameter of the request or the default value
    default @NotNull String
    of(@NotNull HttpContext context, @NotNull String defaultValue)
    Returns the last parameter value of the request or a default value
    default <V extends Enum<V>>
    V
    of(@NotNull HttpContext context, V defaultValue)
    Returns a parameter of the request or the Enum class
    default <V> V
    of(@NotNull HttpContext context, V defaultValue, @NotNull Function<String,V> decoder)
    Returns a parameter of the request or the default value
    default @NotNull String
    of(@NotNull URequest request)
    Default value is an empty String
    default @NotNull String
    of(@NotNull URequest request, @NotNull String defaultValue)
    Returns the last parameter value of the request or a default value.
    default @NotNull String
    Get a raw name of the HTTP parameter.
    default CharSequence
    subSequence(int start, int end)
     
    @NotNull String
    Returns a parameter name

    Methods inherited from interface java.lang.CharSequence

    codePoints, chars, isEmpty
  • Field Details

  • Method Details

    • toString

      @NotNull @NotNull String toString()
      Returns a parameter name
      Specified by:
      toString in interface CharSequence
      Overrides:
      toString in class Object
    • length

      default int length()
      Specified by:
      length in interface CharSequence
    • charAt

      default char charAt(int index)
      Specified by:
      charAt in interface CharSequence
    • subSequence

      default CharSequence subSequence(int start, int end)
      Specified by:
      subSequence in interface CharSequence
    • defaultValue

      @NotNull default @NotNull String defaultValue()
      Returns a non-null default text value. The standard value is an empty String, override it for a change.
    • buildParameterName

      @NotNull default @NotNull String buildParameterName(@Nullable @Nullable String name)
      Build a default non-null parameter name.
    • originalName

      @NotNull default @NotNull String originalName()
      Get a raw name of the HTTP parameter. The method can be called from the buildParameterName(java.lang.String) method. NOTE: The method was renamed from obsolete name() due a Kotlin compatibility.
    • of

      @NotNull default @NotNull String of(@NotNull @NotNull URequest request, @NotNull @NotNull String defaultValue)
      Returns the last parameter value of the request or a default value. The MAIN method
    • of

      @NotNull default @NotNull String of(@NotNull @NotNull HttpContext context, @NotNull @NotNull String defaultValue)
      Returns the last parameter value of the request or a default value
    • of

      @NotNull default @NotNull String of(@NotNull @NotNull HttpContext context)
      Default value is an empty String
    • of

      @NotNull default @NotNull String of(@NotNull @NotNull URequest request)
      Default value is an empty String
    • of

      default boolean of(@NotNull @NotNull HttpContext context, @Nullable @org.jetbrains.annotations.Nullable boolean defaultValue)
      Returns a parameter of the request or the default value
    • of

      default char of(@NotNull @NotNull HttpContext context, @Nullable @org.jetbrains.annotations.Nullable char defaultValue)
      Returns a parameter of the request or the default value
    • of

      default short of(@NotNull @NotNull HttpContext context, @Nullable @org.jetbrains.annotations.Nullable short defaultValue)
      Returns a parameter of the request or the default value
    • of

      default int of(@NotNull @NotNull HttpContext context, @Nullable @org.jetbrains.annotations.Nullable int defaultValue)
      Returns a parameter of the request or the default value
    • of

      default long of(@NotNull @NotNull HttpContext context, @Nullable @org.jetbrains.annotations.Nullable long defaultValue)
      Returns a parameter of the request or the default value
    • of

      default float of(@NotNull @NotNull HttpContext context, @Nullable @org.jetbrains.annotations.Nullable float defaultValue)
      Returns a parameter of the request or the default value
    • of

      default double of(@NotNull @NotNull HttpContext context, @Nullable @org.jetbrains.annotations.Nullable double defaultValue)
      Returns a parameter of the request or the default value
    • of

      @NotNull default <V extends Enum<V>> V of(@NotNull @NotNull HttpContext context, @NotNull V defaultValue)
      Returns a parameter of the request or the Enum class
    • of

      @Nullable default <V extends Enum<V>> V of(@NotNull @NotNull HttpContext context, @NotNull @NotNull Class<V> clazz)
      Returns a parameter of the request or the default value
    • of

      default <V> V of(@NotNull @NotNull HttpContext context, @NotNull V defaultValue, @NotNull @NotNull Function<String,V> decoder)
      Returns a parameter of the request or the default value
    • of

      static HttpParameter of(@NotNull @NotNull String name)
      Create a default implementation
    • of

      static HttpParameter of(@NotNull @NotNull String name, @NotNull @NotNull String defaultValue)
      Create a default implementation