Class TranslationRuntimeLimits.Builder
java.lang.Object
com.lokalized.TranslationRuntimeLimits.Builder
- Enclosing class:
TranslationRuntimeLimits
Builder for
TranslationRuntimeLimits.- Since:
- 3.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds immutable runtime limits.Sets the absolute decimal-scale limit.Sets the compact-decimal-exponent limit.Sets the source-length limit for each whole-message or generated-fragment expression.Sets the nested-group limit for each whole-message or generated-fragment expression.Sets the token-count limit for each whole-message or generated-fragment expression.Sets the cumulative UTF-16 code-unit budget shared by language-form and expression-selected generated fragments in one locale fallback attempt.Sets the generated-placeholder nesting limit shared by language-form and expression-selected fragments.Sets the maximum UTF-16 code-unit count for one interpolated message, generated fragment, or caller-supplied phonetic input.Sets the decimal-precision limit.Sets the explicitly visible-decimal-place limit.
-
Method Details
-
maximumNumberPrecision
Sets the decimal-precision limit.- Parameters:
value- value from 1 throughTranslationRuntimeLimits.MAXIMUM_NUMBER_PRECISION, or null to restore the default- Returns:
- this builder, not null
-
maximumAbsoluteNumberScale
public @NonNull TranslationRuntimeLimits.Builder maximumAbsoluteNumberScale(@Nullable Integer value) Sets the absolute decimal-scale limit.- Parameters:
value- value from 0 throughTranslationRuntimeLimits.MAXIMUM_ABSOLUTE_NUMBER_SCALE, or null to restore the default- Returns:
- this builder, not null
-
maximumVisibleDecimalPlaces
public @NonNull TranslationRuntimeLimits.Builder maximumVisibleDecimalPlaces(@Nullable Integer value) Sets the explicitly visible-decimal-place limit.- Parameters:
value- value from 0 throughTranslationRuntimeLimits.MAXIMUM_VISIBLE_DECIMAL_PLACES, or null to restore the default- Returns:
- this builder, not null
-
maximumCompactExponent
Sets the compact-decimal-exponent limit.- Parameters:
value- value from 0 throughTranslationRuntimeLimits.MAXIMUM_COMPACT_EXPONENT, or null to restore the default- Returns:
- this builder, not null
-
maximumExpressionCharacters
public @NonNull TranslationRuntimeLimits.Builder maximumExpressionCharacters(@Nullable Integer value) Sets the source-length limit for each whole-message or generated-fragment expression.- Parameters:
value- value from 1 throughTranslationRuntimeLimits.MAXIMUM_EXPRESSION_CHARACTERS, or null to restore the default- Returns:
- this builder, not null
-
maximumExpressionTokens
Sets the token-count limit for each whole-message or generated-fragment expression.- Parameters:
value- value from 1 throughTranslationRuntimeLimits.MAXIMUM_EXPRESSION_TOKENS, or null to restore the default- Returns:
- this builder, not null
-
maximumExpressionNestingDepth
public @NonNull TranslationRuntimeLimits.Builder maximumExpressionNestingDepth(@Nullable Integer value) Sets the nested-group limit for each whole-message or generated-fragment expression.- Parameters:
value- value from 0 throughTranslationRuntimeLimits.MAXIMUM_EXPRESSION_NESTING_DEPTH, or null to restore the default- Returns:
- this builder, not null
-
maximumGeneratedPlaceholderDepth
public @NonNull TranslationRuntimeLimits.Builder maximumGeneratedPlaceholderDepth(@Nullable Integer value) Sets the generated-placeholder nesting limit shared by language-form and expression-selected fragments.- Parameters:
value- value from 0 throughTranslationRuntimeLimits.MAXIMUM_GENERATED_PLACEHOLDER_DEPTH, or null to restore the default- Returns:
- this builder, not null
-
maximumInterpolatedOutputCharacters
public @NonNull TranslationRuntimeLimits.Builder maximumInterpolatedOutputCharacters(@Nullable Integer value) Sets the maximum UTF-16 code-unit count for one interpolated message, generated fragment, or caller-supplied phonetic input.- Parameters:
value- value from 1 throughTranslationRuntimeLimits.MAXIMUM_INTERPOLATED_OUTPUT_CHARACTERS, or null to restore the default- Returns:
- this builder, not null
-
maximumGeneratedExpansionCharacters
public @NonNull TranslationRuntimeLimits.Builder maximumGeneratedExpansionCharacters(@Nullable Integer value) Sets the cumulative UTF-16 code-unit budget shared by language-form and expression-selected generated fragments in one locale fallback attempt. Locale fallback starts a fresh budget for each candidate.- Parameters:
value- value from 0 throughTranslationRuntimeLimits.MAXIMUM_GENERATED_EXPANSION_CHARACTERS, or null to restore the default- Returns:
- this builder, not null
-
build
Builds immutable runtime limits.- Returns:
- immutable runtime limits, not null
- Throws:
IllegalArgumentException- if a configured value is outside its documented range
-