public interface HttpParameter extends CharSequence
{ String value = Param.text(httpServletRequest, "my default value"); } enum Param implements HttpParam { REGEXP, TEXT;
Modifier and Type | Method and Description |
---|---|
default String |
defaultValue()
Returns a non-null default text value.
|
default char |
charAt(int index) |
default int |
length() |
default String |
of(javax.servlet.ServletRequest request)
Default value is an empty String
|
default boolean |
of(javax.servlet.ServletRequest request,
boolean defaultValue)
Returns a parameter of the request or the default value
|
default double |
of(javax.servlet.ServletRequest request,
double defaultValue)
Returns a parameter of the request or the default value
|
default float |
of(javax.servlet.ServletRequest request,
float defaultValue)
Returns a parameter of the request or the default value
|
default char |
of(javax.servlet.ServletRequest request,
char defaultValue)
Returns a parameter of the request or the default value
|
default int |
of(javax.servlet.ServletRequest request,
int defaultValue)
Returns a parameter of the request or the default value
|
default long |
of(javax.servlet.ServletRequest request,
long defaultValue)
Returns a parameter of the request or the default value
|
default short |
of(javax.servlet.ServletRequest request,
short defaultValue)
Returns a parameter of the request or the default value
|
default String |
of(javax.servlet.ServletRequest request,
String defaultValue)
Returns the last parameter value of the request or a default value
|
default <V> V |
of(javax.servlet.ServletRequest request,
V defaultValue,
Function<String,V> decoder)
Returns a parameter of the request or the default value
|
static HttpParameter |
of(String name)
Create a default implementation
|
static HttpParameter |
of(String name,
String defaultValue)
Create a default implementation
|
default CharSequence |
subSequence(int start,
int end) |
String |
toString()
Returns a parameter name
|
codePoints, chars
@Nonnull String toString()
toString
in interface CharSequence
toString
in class Object
default int length()
length
in interface CharSequence
default char charAt(int index)
charAt
in interface CharSequence
default CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
@Nonnull default String defaultValue()
@Nonnull default String of(@Nonnull javax.servlet.ServletRequest request)
@Nonnull default String of(@Nonnull javax.servlet.ServletRequest request, @Nonnull String defaultValue)
default boolean of(@Nonnull javax.servlet.ServletRequest request, @Nullable boolean defaultValue)
default char of(@Nonnull javax.servlet.ServletRequest request, @Nullable char defaultValue)
default short of(@Nonnull javax.servlet.ServletRequest request, @Nullable short defaultValue)
default int of(@Nonnull javax.servlet.ServletRequest request, @Nullable int defaultValue)
default long of(@Nonnull javax.servlet.ServletRequest request, @Nullable long defaultValue)
default float of(@Nonnull javax.servlet.ServletRequest request, @Nullable float defaultValue)
default double of(@Nonnull javax.servlet.ServletRequest request, @Nullable double defaultValue)
default <V> V of(@Nonnull javax.servlet.ServletRequest request, @Nonnull V defaultValue, @Nonnull Function<String,V> decoder)
static HttpParameter of(@Nonnull String name)
static HttpParameter of(@Nonnull String name, @Nonnull String defaultValue)
Copyright 2019-2022, Pavel Ponec