Package org.apache.tapestry5.internal
Class AbstractEventContext
- java.lang.Object
-
- org.apache.tapestry5.internal.AbstractEventContext
-
- All Implemented Interfaces:
EventContext
- Direct Known Subclasses:
ArrayEventContext,URLEventContext
public abstract class AbstractEventContext extends java.lang.Object implements EventContext
-
-
Constructor Summary
Constructors Constructor Description AbstractEventContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisEmpty()Returnstrueif this context contains no elements.java.lang.StringtoString()java.lang.String[]toStrings()Extracts the value of each context value as a string.<T> java.util.Optional<T>tryGet(java.lang.Class<T> desiredType, int index)Tries to extract a parameter value and coerces or decodes it to the desired type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.tapestry5.EventContext
get, getCount
-
-
-
-
Constructor Detail
-
AbstractEventContext
public AbstractEventContext()
-
-
Method Detail
-
toStrings
public java.lang.String[] toStrings()
Description copied from interface:EventContextExtracts the value of each context value as a string.- Specified by:
toStringsin interfaceEventContext- Returns:
- context values
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isEmpty
public boolean isEmpty()
Description copied from interface:EventContextReturnstrueif this context contains no elements.- Specified by:
isEmptyin interfaceEventContext
-
tryGet
public <T> java.util.Optional<T> tryGet(java.lang.Class<T> desiredType, int index)
Description copied from interface:EventContextTries to extract a parameter value and coerces or decodes it to the desired type.- Specified by:
tryGetin 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.
-
-