Module dev.metaschema.core
Class IAllowedValuesConstraint.Builder
java.lang.Object
dev.metaschema.core.model.constraint.AbstractConstraintBuilder<IAllowedValuesConstraint.Builder,IAllowedValuesConstraint>
dev.metaschema.core.model.constraint.IAllowedValuesConstraint.Builder
- Enclosing interface:
- IAllowedValuesConstraint
public static final class IAllowedValuesConstraint.Builder
extends AbstractConstraintBuilder<IAllowedValuesConstraint.Builder,IAllowedValuesConstraint>
Provides a builder pattern for constructing a new
IAllowedValuesConstraint.-
Method Summary
Modifier and TypeMethodDescriptionallowedValue(IAllowedValue allowedValue) Use the provided allowed value to validate associated values.allowedValues(Map<String, IAllowedValue> allowedValues) Use the provided allowed values to validate associated values.allowsOther(boolean bool) Determine if unspecified values are allowed and will result in the constraint always passing.extensible(IAllowedValuesConstraint.Extensible extensible) Determine the allowed scope of extension for other constraints matching this constraint's target.protected IAllowedValuesConstraint.BuildergetThis()Get the builder.protected IAllowedValuesConstraintGet a new instance of the built object.Methods inherited from class dev.metaschema.core.model.constraint.AbstractConstraintBuilder
build, description, formalName, getDescription, getFormalName, getId, getLevel, getProperties, getRemarks, getSource, getTarget, identifier, level, properties, property, property, remarks, source, target, validate
-
Method Details
-
allowedValue
Use the provided allowed value to validate associated values.- Parameters:
allowedValue- an expected allowed value- Returns:
- this builder
-
allowedValues
@NonNull public IAllowedValuesConstraint.Builder allowedValues(@NonNull Map<String, IAllowedValue> allowedValues) Use the provided allowed values to validate associated values.- Parameters:
allowedValues- an expected allowed values- Returns:
- this builder
-
allowsOther
Determine if unspecified values are allowed and will result in the constraint always passing.- Parameters:
bool-trueif other values are allowed orfalseotherwise- Returns:
- this builder
-
extensible
@NonNull public IAllowedValuesConstraint.Builder extensible(@NonNull IAllowedValuesConstraint.Extensible extensible) Determine the allowed scope of extension for other constraints matching this constraint's target.- Parameters:
extensible- the degree of allowed extension- Returns:
- this builder
-
getThis
Description copied from class:AbstractConstraintBuilderGet the builder.Implementations of this method must return
this.- Specified by:
getThisin classAbstractConstraintBuilder<IAllowedValuesConstraint.Builder,IAllowedValuesConstraint> - Returns:
- the builder instance
-
newInstance
Description copied from class:AbstractConstraintBuilderGet a new instance of the built object.- Specified by:
newInstancein classAbstractConstraintBuilder<IAllowedValuesConstraint.Builder,IAllowedValuesConstraint> - Returns:
- the built instance
-