Class ContextConfiguration.Builder
- java.lang.Object
-
- com.hubspot.jinjava.interpret.ContextConfiguration.Builder
-
- Enclosing class:
- ContextConfiguration
@NotThreadSafe public static final class ContextConfiguration.Builder extends java.lang.Object
Builds instances of typeContextConfiguration
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.Builder
is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContextConfiguration
build()
Builds a newContextConfiguration
.ContextConfiguration.Builder
from(ContextConfigurationIF instance)
Fill a builder with attribute values from the providedContextConfigurationIF
instance.ContextConfiguration.Builder
setDeferLargeObjects(boolean deferLargeObjects)
Initializes the value for thedeferLargeObjects
attribute.ContextConfiguration.Builder
setDeferredExecutionMode(boolean deferredExecutionMode)
Initializes the value for thedeferredExecutionMode
attribute.ContextConfiguration.Builder
setDynamicVariableResolver(DynamicVariableResolver dynamicVariableResolver)
Initializes the value for thedynamicVariableResolver
attribute.ContextConfiguration.Builder
setExpressionStrategy(ExpressionStrategy expressionStrategy)
Initializes the value for theexpressionStrategy
attribute.ContextConfiguration.Builder
setPartialMacroEvaluation(boolean partialMacroEvaluation)
Initializes the value for thepartialMacroEvaluation
attribute.ContextConfiguration.Builder
setThrowInterpreterErrors(boolean throwInterpreterErrors)
Initializes the value for thethrowInterpreterErrors
attribute.ContextConfiguration.Builder
setUnwrapRawOverride(boolean unwrapRawOverride)
Initializes the value for theunwrapRawOverride
attribute.ContextConfiguration.Builder
setValidationMode(boolean validationMode)
Initializes the value for thevalidationMode
attribute.
-
-
-
Method Detail
-
from
public final ContextConfiguration.Builder from(ContextConfigurationIF instance)
Fill a builder with attribute values from the providedContextConfigurationIF
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setExpressionStrategy
public final ContextConfiguration.Builder setExpressionStrategy(ExpressionStrategy expressionStrategy)
Initializes the value for theexpressionStrategy
attribute.If not set, this attribute will have a default value as returned by the initializer of
expressionStrategy
.- Parameters:
expressionStrategy
- The value for expressionStrategy- Returns:
this
builder for use in a chained invocation
-
setDynamicVariableResolver
public final ContextConfiguration.Builder setDynamicVariableResolver(@Nullable DynamicVariableResolver dynamicVariableResolver)
Initializes the value for thedynamicVariableResolver
attribute.- Parameters:
dynamicVariableResolver
- The value for dynamicVariableResolver (can benull
)- Returns:
this
builder for use in a chained invocation
-
setValidationMode
public final ContextConfiguration.Builder setValidationMode(boolean validationMode)
Initializes the value for thevalidationMode
attribute.If not set, this attribute will have a default value as returned by the initializer of
validationMode
.- Parameters:
validationMode
- The value for validationMode- Returns:
this
builder for use in a chained invocation
-
setDeferredExecutionMode
public final ContextConfiguration.Builder setDeferredExecutionMode(boolean deferredExecutionMode)
Initializes the value for thedeferredExecutionMode
attribute.If not set, this attribute will have a default value as returned by the initializer of
deferredExecutionMode
.- Parameters:
deferredExecutionMode
- The value for deferredExecutionMode- Returns:
this
builder for use in a chained invocation
-
setDeferLargeObjects
public final ContextConfiguration.Builder setDeferLargeObjects(boolean deferLargeObjects)
Initializes the value for thedeferLargeObjects
attribute.If not set, this attribute will have a default value as returned by the initializer of
deferLargeObjects
.- Parameters:
deferLargeObjects
- The value for deferLargeObjects- Returns:
this
builder for use in a chained invocation
-
setThrowInterpreterErrors
public final ContextConfiguration.Builder setThrowInterpreterErrors(boolean throwInterpreterErrors)
Initializes the value for thethrowInterpreterErrors
attribute.If not set, this attribute will have a default value as returned by the initializer of
throwInterpreterErrors
.- Parameters:
throwInterpreterErrors
- The value for throwInterpreterErrors- Returns:
this
builder for use in a chained invocation
-
setPartialMacroEvaluation
public final ContextConfiguration.Builder setPartialMacroEvaluation(boolean partialMacroEvaluation)
Initializes the value for thepartialMacroEvaluation
attribute.If not set, this attribute will have a default value as returned by the initializer of
partialMacroEvaluation
.- Parameters:
partialMacroEvaluation
- The value for partialMacroEvaluation- Returns:
this
builder for use in a chained invocation
-
setUnwrapRawOverride
public final ContextConfiguration.Builder setUnwrapRawOverride(boolean unwrapRawOverride)
Initializes the value for theunwrapRawOverride
attribute.If not set, this attribute will have a default value as returned by the initializer of
unwrapRawOverride
.- Parameters:
unwrapRawOverride
- The value for unwrapRawOverride- Returns:
this
builder for use in a chained invocation
-
build
public ContextConfiguration build()
Builds a newContextConfiguration
.- Returns:
- An immutable instance of ContextConfiguration
- Throws:
com.hubspot.immutables.validation.InvalidImmutableStateException
- if any required attributes are missing
-
-