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.ObjectBuilds instances of typeContextConfiguration. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis 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 ContextConfigurationbuild()Builds a newContextConfiguration.ContextConfiguration.Builderfrom(ContextConfigurationIF instance)Fill a builder with attribute values from the providedContextConfigurationIFinstance.ContextConfiguration.BuildersetDeferLargeObjects(boolean deferLargeObjects)Initializes the value for thedeferLargeObjectsattribute.ContextConfiguration.BuildersetDeferredExecutionMode(boolean deferredExecutionMode)Initializes the value for thedeferredExecutionModeattribute.ContextConfiguration.BuildersetDynamicVariableResolver(DynamicVariableResolver dynamicVariableResolver)Initializes the value for thedynamicVariableResolverattribute.ContextConfiguration.BuildersetExpressionStrategy(ExpressionStrategy expressionStrategy)Initializes the value for theexpressionStrategyattribute.ContextConfiguration.BuildersetPartialMacroEvaluation(boolean partialMacroEvaluation)Initializes the value for thepartialMacroEvaluationattribute.ContextConfiguration.BuildersetThrowInterpreterErrors(boolean throwInterpreterErrors)Initializes the value for thethrowInterpreterErrorsattribute.ContextConfiguration.BuildersetUnwrapRawOverride(boolean unwrapRawOverride)Initializes the value for theunwrapRawOverrideattribute.ContextConfiguration.BuildersetValidationMode(boolean validationMode)Initializes the value for thevalidationModeattribute.
-
-
-
Method Detail
-
from
public final ContextConfiguration.Builder from(ContextConfigurationIF instance)
Fill a builder with attribute values from the providedContextConfigurationIFinstance. 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:
thisbuilder for use in a chained invocation
-
setExpressionStrategy
public final ContextConfiguration.Builder setExpressionStrategy(ExpressionStrategy expressionStrategy)
Initializes the value for theexpressionStrategyattribute.If not set, this attribute will have a default value as returned by the initializer of
expressionStrategy.- Parameters:
expressionStrategy- The value for expressionStrategy- Returns:
thisbuilder for use in a chained invocation
-
setDynamicVariableResolver
public final ContextConfiguration.Builder setDynamicVariableResolver(@Nullable DynamicVariableResolver dynamicVariableResolver)
Initializes the value for thedynamicVariableResolverattribute.- Parameters:
dynamicVariableResolver- The value for dynamicVariableResolver (can benull)- Returns:
thisbuilder for use in a chained invocation
-
setValidationMode
public final ContextConfiguration.Builder setValidationMode(boolean validationMode)
Initializes the value for thevalidationModeattribute.If not set, this attribute will have a default value as returned by the initializer of
validationMode.- Parameters:
validationMode- The value for validationMode- Returns:
thisbuilder for use in a chained invocation
-
setDeferredExecutionMode
public final ContextConfiguration.Builder setDeferredExecutionMode(boolean deferredExecutionMode)
Initializes the value for thedeferredExecutionModeattribute.If not set, this attribute will have a default value as returned by the initializer of
deferredExecutionMode.- Parameters:
deferredExecutionMode- The value for deferredExecutionMode- Returns:
thisbuilder for use in a chained invocation
-
setDeferLargeObjects
public final ContextConfiguration.Builder setDeferLargeObjects(boolean deferLargeObjects)
Initializes the value for thedeferLargeObjectsattribute.If not set, this attribute will have a default value as returned by the initializer of
deferLargeObjects.- Parameters:
deferLargeObjects- The value for deferLargeObjects- Returns:
thisbuilder for use in a chained invocation
-
setThrowInterpreterErrors
public final ContextConfiguration.Builder setThrowInterpreterErrors(boolean throwInterpreterErrors)
Initializes the value for thethrowInterpreterErrorsattribute.If not set, this attribute will have a default value as returned by the initializer of
throwInterpreterErrors.- Parameters:
throwInterpreterErrors- The value for throwInterpreterErrors- Returns:
thisbuilder for use in a chained invocation
-
setPartialMacroEvaluation
public final ContextConfiguration.Builder setPartialMacroEvaluation(boolean partialMacroEvaluation)
Initializes the value for thepartialMacroEvaluationattribute.If not set, this attribute will have a default value as returned by the initializer of
partialMacroEvaluation.- Parameters:
partialMacroEvaluation- The value for partialMacroEvaluation- Returns:
thisbuilder for use in a chained invocation
-
setUnwrapRawOverride
public final ContextConfiguration.Builder setUnwrapRawOverride(boolean unwrapRawOverride)
Initializes the value for theunwrapRawOverrideattribute.If not set, this attribute will have a default value as returned by the initializer of
unwrapRawOverride.- Parameters:
unwrapRawOverride- The value for unwrapRawOverride- Returns:
thisbuilder 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
-
-