Class ServerValuesValue
java.lang.Object
org.apache.juneau.console.widgets.ServerValuesValue
An immutable named server-side scalar value declaration held by a
ServerValues bean.
Each value pairs a stable name (the key an author interpolates as provider. The provider is invoked at serve time against a per-render
VarResolverSession and must return a scalar (String / Number / Boolean) or
toString()-ed.
cacheable defaults to
- Since:
- 10.0.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerValuesValueof(String name, Function<VarResolverSession, ?> provider) Creates a non-cacheable value.static ServerValuesValueof(String name, Function<VarResolverSession, ?> provider, boolean cacheable) Creates a value with an explicit cacheable flag.
-
Field Details
-
name
The interpolation name (thexin"$FV{x}" ). Must not be null or blank. -
provider
The session-aware scalar provider. Must not be null. -
cacheable
Whether the resolved value may be memoized for the lifetime of a single render. Defaults to false.
-
-
Method Details
-
of
Creates a non-cacheable value.- Parameters:
name- The interpolation name.provider- The session-aware scalar provider.- Returns:
- A new
ServerValuesValuewithcacheable=false.
-
of
public static ServerValuesValue of(String name, Function<VarResolverSession, ?> provider, boolean cacheable) Creates a value with an explicit cacheable flag.- Parameters:
name- The interpolation name.provider- The session-aware scalar provider.cacheable- Whether the resolved value may be memoized within a single render.- Returns:
- A new
ServerValuesValue.
-