java.lang.Object
com.aoapps.lang.attribute.Attribute<ServletRequest,T>
com.aoapps.servlet.attribute.AttributeEE<ServletRequest,T>
com.aoapps.servlet.attribute.AttributeEE.Request<T>
- Enclosing class:
AttributeEE<C,
T>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.aoapps.servlet.attribute.AttributeEE
AttributeEE.Application<T>, AttributeEE.Jstl<T>, AttributeEE.Name<T>, AttributeEE.Page<T>, AttributeEE.Request<T>, AttributeEE.Session<T>
Nested classes/interfaces inherited from class com.aoapps.lang.attribute.Attribute
Attribute.OldValue
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompute
(BiFunctionE<? super String, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.compute(java.lang.Object, java.util.function.BiFunction)
, but for this request-scope attribute.static <T,
Ex extends Throwable>
Tcompute
(ServletRequest request, String name, BiFunctionE<? super String, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.compute(java.lang.Object, java.util.function.BiFunction)
, but for a request-scope attribute.computeIfAbsent
(FunctionE<? super String, ? extends T, ? extends Ex> mappingFunction) Much likeMap.computeIfAbsent(java.lang.Object, java.util.function.Function)
, but for this request-scope attribute.static <T,
Ex extends Throwable>
TcomputeIfAbsent
(ServletRequest request, String name, FunctionE<? super String, ? extends T, ? extends Ex> mappingFunction) Much likeMap.computeIfAbsent(java.lang.Object, java.util.function.Function)
, but for a request-scope attribute.computeIfPresent
(BiFunctionE<? super String, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.computeIfPresent(java.lang.Object, java.util.function.BiFunction)
, but for this request-scope attribute.static <T,
Ex extends Throwable>
TcomputeIfPresent
(ServletRequest request, String name, BiFunctionE<? super String, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.computeIfPresent(java.lang.Object, java.util.function.BiFunction)
, but for a request-scope attribute.get()
Gets the value of this request-scope attribute.static <T> T
get
(ServletRequest request, String name) Gets a request-scope attribute.Gets the request context for this attribute.static <T> T
getOrDefault
(ServletRequest request, String name, T defaultValue) Much likeMap.getOrDefault(java.lang.Object, java.lang.Object)
, but for a request-scope attribute.getOrDefault
(T defaultValue) Much likeMap.getOrDefault(java.lang.Object, java.lang.Object)
, but for this request-scope attribute.Initializes this request-scope attribute, returning a backup value, which must beclosed
to restore the old value.static <T,
Ex extends Throwable>
Tmerge
(ServletRequest request, String name, T value, BiFunctionE<? super T, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.merge(java.lang.Object, java.lang.Object, java.util.function.BiFunction)
, but for this request-scope attribute.void
remove()
Removes the value from this request-scope attribute.static void
remove
(ServletRequest request, String name) Removes a request-scope attribute.static <T> boolean
remove
(ServletRequest request, String name, T value) Much likeMap.remove(java.lang.Object, java.lang.Object)
, but for a request-scope attribute.boolean
Much likeMap.remove(java.lang.Object, java.lang.Object)
, but for this request-scope attribute.static <T> T
replace
(ServletRequest request, String name, T value) Much likeMap.replace(java.lang.Object, java.lang.Object)
, but for a request-scope attribute.static <T> boolean
replace
(ServletRequest request, String name, T oldValue, T newValue) Much likeMap.replace(java.lang.Object, java.lang.Object, java.lang.Object)
, but for a request-scope attribute.Much likeMap.replace(java.lang.Object, java.lang.Object)
, but for this request-scope attribute.boolean
Much likeMap.replace(java.lang.Object, java.lang.Object, java.lang.Object)
, but for this request-scope attribute.static <T> void
set
(ServletRequest request, String name, T value) Sets a request-scope attribute.void
Sets the value of this request-scope attribute.static <T> T
setIfAbsent
(ServletRequest request, String name, T value) Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object)
, but for a request-scope attribute.setIfAbsent
(T value) Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object)
, but for this request-scope attribute.Methods inherited from class com.aoapps.servlet.attribute.AttributeEE
attribute, jstl
-
Method Details
-
getContext
Gets the request context for this attribute.- Specified by:
getContext
in classAttributeEE<ServletRequest,
T>
-
init
Initializes this request-scope attribute, returning a backup value, which must beclosed
to restore the old value. This is best used in try-with-resources.- Specified by:
init
in classAttribute<ServletRequest,
T>
-
compute
public static <T,Ex extends Throwable> T compute(ServletRequest request, String name, BiFunctionE<? super String, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.compute(java.lang.Object, java.util.function.BiFunction)
, but for a request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Throws:
Ex
- See Also:
-
compute
public <Ex extends Throwable> T compute(BiFunctionE<? super String, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.compute(java.lang.Object, java.util.function.BiFunction)
, but for this request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Specified by:
compute
in classAttribute<ServletRequest,
T> - Throws:
Ex
- See Also:
-
computeIfAbsent
public static <T,Ex extends Throwable> T computeIfAbsent(ServletRequest request, String name, FunctionE<? super String, ? extends T, throws Ex? extends Ex> mappingFunction) Much likeMap.computeIfAbsent(java.lang.Object, java.util.function.Function)
, but for a request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Throws:
Ex
- See Also:
-
computeIfAbsent
public <Ex extends Throwable> T computeIfAbsent(FunctionE<? super String, ? extends T, throws Ex? extends Ex> mappingFunction) Much likeMap.computeIfAbsent(java.lang.Object, java.util.function.Function)
, but for this request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Specified by:
computeIfAbsent
in classAttribute<ServletRequest,
T> - Throws:
Ex
- See Also:
-
computeIfPresent
public static <T,Ex extends Throwable> T computeIfPresent(ServletRequest request, String name, BiFunctionE<? super String, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.computeIfPresent(java.lang.Object, java.util.function.BiFunction)
, but for a request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Throws:
Ex
- See Also:
-
computeIfPresent
public <Ex extends Throwable> T computeIfPresent(BiFunctionE<? super String, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.computeIfPresent(java.lang.Object, java.util.function.BiFunction)
, but for this request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Specified by:
computeIfPresent
in classAttribute<ServletRequest,
T> - Throws:
Ex
- See Also:
-
get
Gets a request-scope attribute.- Parameters:
request
- may benull
, which will returnnull
-
get
Gets the value of this request-scope attribute.- Specified by:
get
in classAttribute<ServletRequest,
T>
-
getOrDefault
Much likeMap.getOrDefault(java.lang.Object, java.lang.Object)
, but for a request-scope attribute.- Parameters:
request
- may benull
, which will returndefaultValue
- See Also:
-
getOrDefault
Much likeMap.getOrDefault(java.lang.Object, java.lang.Object)
, but for this request-scope attribute.- Specified by:
getOrDefault
in classAttribute<ServletRequest,
T> - See Also:
-
merge
public static <T,Ex extends Throwable> T merge(ServletRequest request, String name, T value, BiFunctionE<? super T, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.merge(java.lang.Object, java.lang.Object, java.util.function.BiFunction)
, but for a request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Throws:
Ex
- See Also:
-
merge
public <Ex extends Throwable> T merge(T value, BiFunctionE<? super T, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.merge(java.lang.Object, java.lang.Object, java.util.function.BiFunction)
, but for this request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Specified by:
merge
in classAttribute<ServletRequest,
T> - Throws:
Ex
- See Also:
-
remove
Removes a request-scope attribute.- Parameters:
request
- may benull
, which will skip removal
-
remove
public void remove()Removes the value from this request-scope attribute.- Specified by:
remove
in classAttribute<ServletRequest,
T>
-
remove
Much likeMap.remove(java.lang.Object, java.lang.Object)
, but for a request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- See Also:
-
remove
Much likeMap.remove(java.lang.Object, java.lang.Object)
, but for this request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Specified by:
remove
in classAttribute<ServletRequest,
T> - See Also:
-
replace
Much likeMap.replace(java.lang.Object, java.lang.Object)
, but for a request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- See Also:
-
replace
Much likeMap.replace(java.lang.Object, java.lang.Object)
, but for this request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Specified by:
replace
in classAttribute<ServletRequest,
T> - See Also:
-
replace
Much likeMap.replace(java.lang.Object, java.lang.Object, java.lang.Object)
, but for a request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- See Also:
-
replace
Much likeMap.replace(java.lang.Object, java.lang.Object, java.lang.Object)
, but for this request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Specified by:
replace
in classAttribute<ServletRequest,
T> - See Also:
-
set
Sets a request-scope attribute. -
set
Sets the value of this request-scope attribute.- Specified by:
set
in classAttribute<ServletRequest,
T>
-
setIfAbsent
Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object)
, but for a request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- See Also:
-
setIfAbsent
Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object)
, but for this request-scope attribute. Synchronizes onrequest
to ensure atomic operation.- Specified by:
setIfAbsent
in classAttribute<ServletRequest,
T> - See Also:
-