Class SdkPojoBuilder<T extends SdkPojo>

java.lang.Object
software.amazon.awssdk.core.SdkPojoBuilder<T>
All Implemented Interfaces:
SdkPojo, Buildable

public final class SdkPojoBuilder<T extends SdkPojo> extends Object implements SdkPojo, Buildable
A builder for an immutable SdkPojo with no fields.

This is useful for SdkPojo implementations that don't have their own builders, but need to be passed to something that assumes they already have a builder. For example, marshallers expect all SdkPojo implementations to have a builder. In the cases that they do not, this can be used as their builder.

This currently only supports SdkPojos without any fields (because it has no way to set them). It also does not support SdkPojos that already have or are a builder (that builder should be used instead).

  • Constructor Details

    • SdkPojoBuilder

      public SdkPojoBuilder(T delegate)
  • Method Details

    • sdkFields

      public 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.
    • equalsBySdkFields

      public boolean equalsBySdkFields(Object other)
      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:
      other - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • build

      public T build()
      Specified by:
      build in interface Buildable