Class SdkField.Builder<TypeT>

  • Type Parameters:
    TypeT - Java type of field.
    Enclosing class:
    SdkField<TypeT>

    public static final class SdkField.Builder<TypeT>
    extends Object
    Builder for SdkField.
    • Method Detail

      • constructor

        public SdkField.Builder<TypeT> constructor​(Supplier<SdkPojo> constructor)
        Sets a Supplier which will create a new MUTABLE instance of the POJO. I.E. this will create the Builder for a given POJO and not the immutable POJO itself.
        Parameters:
        constructor - Supplier method to create the mutable POJO.
        Returns:
        This object for method chaining.
      • setter

        public SdkField.Builder<TypeT> setter​(BiConsumer<Object,​TypeT> setter)
        Sets the BiConsumer which will accept an object and a value and set that value on the appropriate member of the object. This requires a MUTABLE pojo so thus this setter will be on the Builder for the given POJO.
        Parameters:
        setter - Setter method.
        Returns:
        This object for method chaining.
      • getter

        public SdkField.Builder<TypeT> getter​(Function<Object,​TypeT> getter)
        Sets the Function that will accept an object and return the current value of 'this' field on that object. This will typically be a getter on the immutable representation of the POJO and is used mostly during marshalling.
        Parameters:
        getter - Getter method.
        Returns:
        This object for method chaining.
      • traits

        public SdkField.Builder<TypeT> traits​(Trait... traits)
        Attaches one or more traits to the SdkField. Traits can have additional metadata and behavior that influence how a field is marshalled/unmarshalled.
        Parameters:
        traits - Traits to attach.
        Returns:
        This object for method chaining.