Class X12ValidationRule

java.lang.Object
software.amazon.awssdk.services.b2bi.model.X12ValidationRule
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<X12ValidationRule.Builder,X12ValidationRule>

@Generated("software.amazon.awssdk:codegen") public final class X12ValidationRule extends Object implements SdkPojo, Serializable, ToCopyableBuilder<X12ValidationRule.Builder,X12ValidationRule>

Represents a single validation rule that can be applied during X12 EDI processing. This is a union type that can contain one of several specific validation rule types: code list validation rules for modifying allowed element codes, element length validation rules for enforcing custom length constraints, or element requirement validation rules for changing mandatory/optional status. Each validation rule targets specific aspects of EDI document validation to ensure compliance with trading partner requirements and business rules.

See Also:
  • Method Details

    • codeListValidationRule

      public final X12CodeListValidationRule codeListValidationRule()

      Specifies a code list validation rule that modifies the allowed code values for a specific X12 element. This rule enables you to customize which codes are considered valid for an element, allowing for trading partner-specific code requirements.

      Returns:
      Specifies a code list validation rule that modifies the allowed code values for a specific X12 element. This rule enables you to customize which codes are considered valid for an element, allowing for trading partner-specific code requirements.
    • elementLengthValidationRule

      public final X12ElementLengthValidationRule elementLengthValidationRule()

      Specifies an element length validation rule that defines custom length constraints for a specific X12 element. This rule allows you to enforce minimum and maximum length requirements that may differ from the standard X12 specification.

      Returns:
      Specifies an element length validation rule that defines custom length constraints for a specific X12 element. This rule allows you to enforce minimum and maximum length requirements that may differ from the standard X12 specification.
    • elementRequirementValidationRule

      public final X12ElementRequirementValidationRule elementRequirementValidationRule()

      Specifies an element requirement validation rule that modifies whether a specific X12 element is required or optional within a segment. This rule provides flexibility to accommodate different trading partner requirements for element presence.

      Returns:
      Specifies an element requirement validation rule that modifies whether a specific X12 element is required or optional within a segment. This rule provides flexibility to accommodate different trading partner requirements for element presence.
    • toBuilder

      public X12ValidationRule.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<X12ValidationRule.Builder,X12ValidationRule>
      Returns:
      a builder for type T
    • builder

      public static X12ValidationRule.Builder builder()
    • serializableBuilderClass

      public static Class<? extends X12ValidationRule.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • fromCodeListValidationRule

      public static X12ValidationRule fromCodeListValidationRule(X12CodeListValidationRule codeListValidationRule)
      Create an instance of this class with codeListValidationRule() initialized to the given value.

      Specifies a code list validation rule that modifies the allowed code values for a specific X12 element. This rule enables you to customize which codes are considered valid for an element, allowing for trading partner-specific code requirements.

      Parameters:
      codeListValidationRule - Specifies a code list validation rule that modifies the allowed code values for a specific X12 element. This rule enables you to customize which codes are considered valid for an element, allowing for trading partner-specific code requirements.
    • fromCodeListValidationRule

      public static X12ValidationRule fromCodeListValidationRule(Consumer<X12CodeListValidationRule.Builder> codeListValidationRule)
      Create an instance of this class with codeListValidationRule() initialized to the given value.

      Specifies a code list validation rule that modifies the allowed code values for a specific X12 element. This rule enables you to customize which codes are considered valid for an element, allowing for trading partner-specific code requirements.

      Parameters:
      codeListValidationRule - Specifies a code list validation rule that modifies the allowed code values for a specific X12 element. This rule enables you to customize which codes are considered valid for an element, allowing for trading partner-specific code requirements.
    • fromElementLengthValidationRule

      public static X12ValidationRule fromElementLengthValidationRule(X12ElementLengthValidationRule elementLengthValidationRule)
      Create an instance of this class with elementLengthValidationRule() initialized to the given value.

      Specifies an element length validation rule that defines custom length constraints for a specific X12 element. This rule allows you to enforce minimum and maximum length requirements that may differ from the standard X12 specification.

      Parameters:
      elementLengthValidationRule - Specifies an element length validation rule that defines custom length constraints for a specific X12 element. This rule allows you to enforce minimum and maximum length requirements that may differ from the standard X12 specification.
    • fromElementLengthValidationRule

      public static X12ValidationRule fromElementLengthValidationRule(Consumer<X12ElementLengthValidationRule.Builder> elementLengthValidationRule)
      Create an instance of this class with elementLengthValidationRule() initialized to the given value.

      Specifies an element length validation rule that defines custom length constraints for a specific X12 element. This rule allows you to enforce minimum and maximum length requirements that may differ from the standard X12 specification.

      Parameters:
      elementLengthValidationRule - Specifies an element length validation rule that defines custom length constraints for a specific X12 element. This rule allows you to enforce minimum and maximum length requirements that may differ from the standard X12 specification.
    • fromElementRequirementValidationRule

      public static X12ValidationRule fromElementRequirementValidationRule(X12ElementRequirementValidationRule elementRequirementValidationRule)
      Create an instance of this class with elementRequirementValidationRule() initialized to the given value.

      Specifies an element requirement validation rule that modifies whether a specific X12 element is required or optional within a segment. This rule provides flexibility to accommodate different trading partner requirements for element presence.

      Parameters:
      elementRequirementValidationRule - Specifies an element requirement validation rule that modifies whether a specific X12 element is required or optional within a segment. This rule provides flexibility to accommodate different trading partner requirements for element presence.
    • fromElementRequirementValidationRule

      public static X12ValidationRule fromElementRequirementValidationRule(Consumer<X12ElementRequirementValidationRule.Builder> elementRequirementValidationRule)
      Create an instance of this class with elementRequirementValidationRule() initialized to the given value.

      Specifies an element requirement validation rule that modifies whether a specific X12 element is required or optional within a segment. This rule provides flexibility to accommodate different trading partner requirements for element presence.

      Parameters:
      elementRequirementValidationRule - Specifies an element requirement validation rule that modifies whether a specific X12 element is required or optional within a segment. This rule provides flexibility to accommodate different trading partner requirements for element presence.
    • type

      public X12ValidationRule.Type type()
      Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will be X12ValidationRule.Type.UNKNOWN_TO_SDK_VERSION if 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 be X12ValidationRule.Type.UNKNOWN_TO_SDK_VERSION if zero members are set, and null if more than one member is set.
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.