@NotThreadSafe public final class RangeConstraintBuilder<T extends Number & Comparable<T>> extends Object
RangeConstraint
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
RangeConstraintBuilder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
Constructor and Description |
---|
RangeConstraintBuilder()
Creates a builder for
RangeConstraint instances. |
Modifier and Type | Method and Description |
---|---|
RangeConstraintBuilder<T> |
allowedRanges(com.google.common.collect.RangeSet<T> allowedRanges)
Initializes the value for the
allowedRanges attribute. |
RangeConstraint<T> |
build()
Builds a new
RangeConstraint . |
RangeConstraintBuilder<T> |
description(Optional<String> description)
Initializes the optional value
description to description. |
RangeConstraintBuilder<T> |
description(String description)
Initializes the optional value
description to description. |
RangeConstraintBuilder<T> |
errorAppTag(Optional<String> errorAppTag)
Initializes the optional value
errorAppTag to errorAppTag. |
RangeConstraintBuilder<T> |
errorAppTag(String errorAppTag)
Initializes the optional value
errorAppTag to errorAppTag. |
RangeConstraintBuilder<T> |
errorMessage(Optional<String> errorMessage)
Initializes the optional value
errorMessage to errorMessage. |
RangeConstraintBuilder<T> |
errorMessage(String errorMessage)
Initializes the optional value
errorMessage to errorMessage. |
RangeConstraintBuilder<T> |
reference(Optional<String> reference)
Initializes the optional value
reference to reference. |
RangeConstraintBuilder<T> |
reference(String reference)
Initializes the optional value
reference to reference. |
public RangeConstraintBuilder()
RangeConstraint
instances.public final RangeConstraintBuilder<T> allowedRanges(com.google.common.collect.RangeSet<T> allowedRanges)
allowedRanges
attribute.allowedRanges
- The value for allowedRangesthis
builder for use in a chained invocationpublic final RangeConstraintBuilder<T> errorAppTag(String errorAppTag)
errorAppTag
to errorAppTag.errorAppTag
- The value for errorAppTagthis
builder for chained invocationpublic final RangeConstraintBuilder<T> errorAppTag(Optional<String> errorAppTag)
errorAppTag
to errorAppTag.errorAppTag
- The value for errorAppTagthis
builder for use in a chained invocationpublic final RangeConstraintBuilder<T> errorMessage(String errorMessage)
errorMessage
to errorMessage.errorMessage
- The value for errorMessagethis
builder for chained invocationpublic final RangeConstraintBuilder<T> errorMessage(Optional<String> errorMessage)
errorMessage
to errorMessage.errorMessage
- The value for errorMessagethis
builder for use in a chained invocationpublic final RangeConstraintBuilder<T> description(String description)
description
to description.description
- The value for descriptionthis
builder for chained invocationpublic final RangeConstraintBuilder<T> description(Optional<String> description)
description
to description.description
- The value for descriptionthis
builder for use in a chained invocationpublic final RangeConstraintBuilder<T> reference(String reference)
reference
to reference.reference
- The value for referencethis
builder for chained invocationpublic final RangeConstraintBuilder<T> reference(Optional<String> reference)
reference
to reference.reference
- The value for referencethis
builder for use in a chained invocationpublic RangeConstraint<T> build()
RangeConstraint
.IllegalStateException
- if any required attributes are missingCopyright © 2019 OpenDaylight. All rights reserved.