Class Mode
java.lang.Object
ch.tocco.nice2.optional.cms.api.publish.Mode
Mode for getting the page content.
Can contain any key value pairs to pass to the single content providers. If some content providers should
be skipped at all, use
skipProviders(String, String...)
to create an instance of this class.-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> Optional
<T> Get a value for a specific key.boolean
Shortcut forget(Key)
with boolean values.static <T> Mode.Key
<T> Create a key instance.static Mode
skipProviders
(String first, String... others) Create a mode to skip the specified providers.<T> Mode
Add a key value pair to this mode.
-
Constructor Details
-
Mode
public Mode()
-
-
Method Details
-
skipProviders
Create a mode to skip the specified providers.- Returns:
- a new Mode instance.
-
with
Add a key value pair to this mode.- Type Parameters:
T
- The type of the value.- Parameters:
key
- The key.value
- The value.- Returns:
- the mode.
-
get
Get a value for a specific key.- Type Parameters:
T
- The type of the value.- Parameters:
key
- The key of the value.- Returns:
- the value or
Optional.empty()
if not set or null.
-
is
Shortcut forget(Key)
with boolean values.- Parameters:
key
- The key of the value.- Returns:
- true if the boolean value is set and it equals true, else false.
-
key
Create a key instance.- Parameters:
name
- The name of the key.type
- The type for the value.- Returns:
- the key instance.
-