Package org.apache.tapestry5.internal
Class EmptyEventContext
java.lang.Object
org.apache.tapestry5.internal.EmptyEventContext
- All Implemented Interfaces:
Serializable
,EventContext
Placeholder used when no context is available.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
This should never be called because the count is always zero.int
getCount()
Always returns zero.boolean
isEmpty()
Returnstrue
if this context contains no elements.String[]
Extracts the value of each context value as a string.<T> Optional<T>
Tries to extract a parameter value and coerces or decodes it to the desired type.
-
Constructor Details
-
EmptyEventContext
public EmptyEventContext()
-
-
Method Details
-
getCount
Always returns zero.- Specified by:
getCount
in interfaceEventContext
-
get
This should never be called because the count is always zero.- Specified by:
get
in interfaceEventContext
- Parameters:
desiredType
- the type of value requiredindex
- identifies which parameter value to extract- Returns:
- the value extracted and converted or coerced
-
toStrings
Description copied from interface:EventContext
Extracts the value of each context value as a string.- Specified by:
toStrings
in interfaceEventContext
- Returns:
- context values
-
isEmpty
Description copied from interface:EventContext
Returnstrue
if this context contains no elements.- Specified by:
isEmpty
in interfaceEventContext
-
tryGet
Description copied from interface:EventContext
Tries to extract a parameter value and coerces or decodes it to the desired type.- Specified by:
tryGet
in interfaceEventContext
- Parameters:
desiredType
- the type of value requiredindex
- identifies which parameter value to extract- Returns:
- the value extracted and converted or coerced, wrapped in an Optional, or
Optional.empty()
if index is out of bounds, or the value can't be converted.
-