Package step.functions.io
Class AbstractSession
java.lang.Object
step.functions.io.AbstractSession
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<T> T<T,U> T getOrDefault(String key, Function<U, T> def, U param) Get a value from the sessionObject.<T> TgetOrDefault(String key, T def) Get a value from the sessionObject.void
-
Field Details
-
sessionObjects
-
-
Constructor Details
-
AbstractSession
public AbstractSession()
-
-
Method Details
-
get
-
getOrDefault
Get a value from the sessionObject. If the value does not exist set the given default value.- Type Parameters:
T- The type of the return value.- Parameters:
key- The key to search in the sessionObjects Map.def- The default value to use if the value does not exist.- Returns:
- The value from sessionObjects or the default value.
-
getOrDefault
Get a value from the sessionObject. If the value does not exist set the given default value.- Type Parameters:
T- The type of the return value.U- The type of the parameter for the default function.- Parameters:
key- The key to search in the sessionObjects Map.def- The function to apply for the default value.param- The parameter for the default function.- Returns:
- The value from sessionObjects or the default value.
-
get
-
put
-
put
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-