Class Constraint
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<Constraint.Builder,Constraint>
The constraint a value failed, named for the Smithy trait or rule that declares it, with what it allows.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Constraint.Builderbuilder()final EnumConstraintThe value is not one of the enum's values.final booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.static ConstraintfromEnumValue(Consumer<EnumConstraint.Builder> enumValue) Create an instance of this class withenumValue()initialized to the given value.static ConstraintfromEnumValue(EnumConstraint enumValue) Create an instance of this class withenumValue()initialized to the given value.static ConstraintfromLength(Consumer<LengthConstraint.Builder> length) Create an instance of this class withlength()initialized to the given value.static ConstraintfromLength(LengthConstraint length) Create an instance of this class withlength()initialized to the given value.static ConstraintfromPattern(Consumer<PatternConstraint.Builder> pattern) Create an instance of this class withpattern()initialized to the given value.static ConstraintfromPattern(PatternConstraint pattern) Create an instance of this class withpattern()initialized to the given value.static ConstraintfromRange(Consumer<RangeConstraint.Builder> range) Create an instance of this class withrange()initialized to the given value.static ConstraintfromRange(RangeConstraint range) Create an instance of this class withrange()initialized to the given value.static ConstraintfromRequired(Boolean required) Create an instance of this class withrequired()initialized to the given value.static ConstraintfromTypeValue(Consumer<TypeConstraint.Builder> typeValue) Create an instance of this class withtypeValue()initialized to the given value.static ConstraintfromTypeValue(TypeConstraint typeValue) Create an instance of this class withtypeValue()initialized to the given value.static ConstraintCreate an instance of this class withunion()initialized to the given value.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) final inthashCode()final LengthConstraintlength()The value's length is outside @length.final PatternConstraintpattern()The value doesn't match @pattern.final RangeConstraintrange()The value is outside @range.final Booleanrequired()The member is @required and missing.static Class<? extends Constraint.Builder> Take this object and create a builder that contains all of the current property values of this object.final StringtoString()Returns a string representation of this object.type()Retrieve an enum value representing which member of this object is populated.final TypeConstraintThe value is not the member's type.final Booleanunion()The union sets no member or more than one.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
required
The member is @required and missing. Always true when set.
- Returns:
- The member is @required and missing. Always true when set.
-
typeValue
The value is not the member's type.
- Returns:
- The value is not the member's type.
-
length
The value's length is outside @length.
- Returns:
- The value's length is outside @length.
-
range
The value is outside @range.
- Returns:
- The value is outside @range.
-
pattern
The value doesn't match @pattern.
- Returns:
- The value doesn't match @pattern.
-
enumValue
The value is not one of the enum's values.
- Returns:
- The value is not one of the enum's values.
-
union
The union sets no member or more than one. Always true when set.
- Returns:
- The union sets no member or more than one. Always true when set.
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<Constraint.Builder,Constraint> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
fromRequired
Create an instance of this class withrequired()initialized to the given value.The member is @required and missing. Always true when set.
- Parameters:
required- The member is @required and missing. Always true when set.
-
fromTypeValue
Create an instance of this class withtypeValue()initialized to the given value.The value is not the member's type.
- Parameters:
typeValue- The value is not the member's type.
-
fromTypeValue
Create an instance of this class withtypeValue()initialized to the given value.The value is not the member's type.
- Parameters:
typeValue- The value is not the member's type.
-
fromLength
Create an instance of this class withlength()initialized to the given value.The value's length is outside @length.
- Parameters:
length- The value's length is outside @length.
-
fromLength
Create an instance of this class withlength()initialized to the given value.The value's length is outside @length.
- Parameters:
length- The value's length is outside @length.
-
fromRange
Create an instance of this class withrange()initialized to the given value.The value is outside @range.
- Parameters:
range- The value is outside @range.
-
fromRange
Create an instance of this class withrange()initialized to the given value.The value is outside @range.
- Parameters:
range- The value is outside @range.
-
fromPattern
Create an instance of this class withpattern()initialized to the given value.The value doesn't match @pattern.
- Parameters:
pattern- The value doesn't match @pattern.
-
fromPattern
Create an instance of this class withpattern()initialized to the given value.The value doesn't match @pattern.
- Parameters:
pattern- The value doesn't match @pattern.
-
fromEnumValue
Create an instance of this class withenumValue()initialized to the given value.The value is not one of the enum's values.
- Parameters:
enumValue- The value is not one of the enum's values.
-
fromEnumValue
Create an instance of this class withenumValue()initialized to the given value.The value is not one of the enum's values.
- Parameters:
enumValue- The value is not one of the enum's values.
-
fromUnion
Create an instance of this class withunion()initialized to the given value.The union sets no member or more than one. Always true when set.
- Parameters:
union- The union sets no member or more than one. Always true when set.
-
type
Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will beConstraint.Type.UNKNOWN_TO_SDK_VERSIONif the service returned a member that is only known to a newer SDK version. When this class is created directly in your code, this will beConstraint.Type.UNKNOWN_TO_SDK_VERSIONif zero members are set, andnullif more than one member is set. -
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-