Package org.jboss.as.controller
Class ListAttributeDefinition.Builder<BUILDER extends ListAttributeDefinition.Builder,ATTRIBUTE extends ListAttributeDefinition>
- java.lang.Object
-
- org.jboss.as.controller.AbstractAttributeDefinitionBuilder<BUILDER,ATTRIBUTE>
-
- org.jboss.as.controller.ListAttributeDefinition.Builder<BUILDER,ATTRIBUTE>
-
- Direct Known Subclasses:
ObjectListAttributeDefinition.Builder
,PrimitiveListAttributeDefinition.Builder
,SimpleListAttributeDefinition.Builder
,StringListAttributeDefinition.Builder
- Enclosing class:
- ListAttributeDefinition
public abstract static class ListAttributeDefinition.Builder<BUILDER extends ListAttributeDefinition.Builder,ATTRIBUTE extends ListAttributeDefinition> extends AbstractAttributeDefinitionBuilder<BUILDER,ATTRIBUTE>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getAllowNullElement()
Gets whether undefined list elements are valid.ParameterValidator
getElementValidator()
Gets the validator to use for validating list elements.int
getMaxSize()
int
getMinSize()
ParameterValidator
getValidator()
BUILDER
setAllowDuplicates(boolean allowDuplicates)
toggles default validator strategy to allow / not allow duplicate elements in listBUILDER
setAllowNullElement(boolean allowNullElement)
Sets whether undefined list elements are valid.BUILDER
setElementValidator(ParameterValidator elementValidator)
Sets the validator to use for validating list elements.BUILDER
setListValidator(ParameterValidator validator)
Sets an overall validator for the list.BUILDER
setValidator(ParameterValidator validator)
Overrides the superclass to simply delegate tosetElementValidator(org.jboss.as.controller.operations.validation.ParameterValidator)
.-
Methods inherited from class org.jboss.as.controller.AbstractAttributeDefinitionBuilder
addAccessConstraint, addAlternatives, addArbitraryDescriptor, addFlag, build, getAccessConstraints, getAllowedValues, getAlternatives, getArbitraryDescriptors, getAttributeGroup, getAttributeMarshaller, getCapabilityReferenceRecorder, getCorrector, getDefaultValue, getDeprecated, getFlags, getMeasurementUnit, getName, getNullSignificant, getParser, getRequires, getType, getUndefinedMetricValue, getXmlName, isAllowExpression, isFlagPresent, isNillable, isResourceOnly, removeAlternatives, removeFlag, setAccessConstraints, setAllowedValues, setAllowedValues, setAllowedValues, setAllowExpression, setAlternatives, setAttributeGroup, setAttributeMarshaller, setAttributeParser, setCapabilityReference, setCapabilityReference, setCapabilityReference, setCapabilityReference, setCapabilityReference, setCapabilityReference, setCorrector, setDefaultValue, setDeprecated, setDeprecated, setExpressionsDeprecated, setFlags, setMaxSize, setMeasurementUnit, setMinSize, setNullSignificant, setRequired, setRequires, setResourceOnly, setRestartAllServices, setRestartJVM, setRuntimeServiceNotRequired, setStorageRuntime, setUndefinedMetricValue, setXmlName
-
-
-
-
Constructor Detail
-
Builder
protected Builder(String attributeName)
-
Builder
protected Builder(String attributeName, boolean optional)
-
Builder
public Builder(ListAttributeDefinition basis)
-
-
Method Detail
-
getElementValidator
public ParameterValidator getElementValidator()
Gets the validator to use for validating list elements. En- Returns:
- the validator, or
null
if no validator has been set
-
setElementValidator
public final BUILDER setElementValidator(ParameterValidator elementValidator)
Sets the validator to use for validating list elements.- Parameters:
elementValidator
- the validator- Returns:
- a builder that can be used to continue building the attribute definition
- Throws:
IllegalArgumentException
- ifelementValidator
isnull
-
setValidator
public BUILDER setValidator(ParameterValidator validator)
Overrides the superclass to simply delegate tosetElementValidator(org.jboss.as.controller.operations.validation.ParameterValidator)
. UsesetListValidator(org.jboss.as.controller.operations.validation.ParameterValidator)
to set an overall validator for the list.- Overrides:
setValidator
in classAbstractAttributeDefinitionBuilder<BUILDER extends ListAttributeDefinition.Builder,ATTRIBUTE extends ListAttributeDefinition>
- Parameters:
validator
- the validator. Cannot benull
- Returns:
- a builder that can be used to continue building the attribute definition
- Throws:
IllegalArgumentException
- ifelementValidator
isnull
-
setListValidator
public BUILDER setListValidator(ParameterValidator validator)
Sets an overall validator for the list.- Parameters:
validator
- the validator.null
is allowed- Returns:
- a builder that can be used to continue building the attribute definition
-
getMinSize
public int getMinSize()
- Overrides:
getMinSize
in classAbstractAttributeDefinitionBuilder<BUILDER extends ListAttributeDefinition.Builder,ATTRIBUTE extends ListAttributeDefinition>
-
getMaxSize
public int getMaxSize()
- Overrides:
getMaxSize
in classAbstractAttributeDefinitionBuilder<BUILDER extends ListAttributeDefinition.Builder,ATTRIBUTE extends ListAttributeDefinition>
-
getAllowNullElement
public boolean getAllowNullElement()
Gets whether undefined list elements are valid. In the unlikely casesetAllowNullElement(boolean)
has been called, that value is returned; otherwise the value ofAbstractAttributeDefinitionBuilder.isNillable()
is used.- Returns:
true
if undefined list elements are valid
-
setAllowNullElement
public BUILDER setAllowNullElement(boolean allowNullElement)
Sets whether undefined list elements are valid.- Parameters:
allowNullElement
- whether undefined elements are valid- Returns:
- a builder that can be used to continue building the attribute definition
-
setAllowDuplicates
public BUILDER setAllowDuplicates(boolean allowDuplicates)
toggles default validator strategy to allow / not allow duplicate elements in list- Parameters:
allowDuplicates
- false if duplicates are not allowed- Returns:
- builder
-
getValidator
public ParameterValidator getValidator()
- Overrides:
getValidator
in classAbstractAttributeDefinitionBuilder<BUILDER extends ListAttributeDefinition.Builder,ATTRIBUTE extends ListAttributeDefinition>
-
-