Class ImmutableComposerEntity.Builder<A>

  • Enclosing class:
    ImmutableComposerEntity<A>

    @NotThreadSafe
    public static final class ImmutableComposerEntity.Builder<A>
    extends Object
    Builds instances of type ImmutableComposerEntity. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final ImmutableComposerEntity.Builder<A> from​(DialobComposer.ComposerEntity<A> instance)
        Fill a builder with attribute values from the provided ComposerEntity instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • id

        @CanIgnoreReturnValue
        public final ImmutableComposerEntity.Builder<A> id​(String id)
        Initializes the value for the id attribute.
        Parameters:
        id - The value for id
        Returns:
        this builder for use in a chained invocation
      • body

        @CanIgnoreReturnValue
        public final ImmutableComposerEntity.Builder<A> body​(A body)
        Initializes the value for the body attribute.
        Parameters:
        body - The value for body
        Returns:
        this builder for use in a chained invocation
      • addErrors

        @CanIgnoreReturnValue
        public final ImmutableComposerEntity.Builder<A> addErrors​(io.dialob.api.rest.Response element)
        Adds one element to errors list.
        Parameters:
        element - A errors element
        Returns:
        this builder for use in a chained invocation
      • addErrors

        @CanIgnoreReturnValue
        public final ImmutableComposerEntity.Builder<A> addErrors​(io.dialob.api.rest.Response... elements)
        Adds elements to errors list.
        Parameters:
        elements - An array of errors elements
        Returns:
        this builder for use in a chained invocation
      • errors

        @CanIgnoreReturnValue
        public final ImmutableComposerEntity.Builder<A> errors​(Iterable<? extends io.dialob.api.rest.Response> elements)
        Sets or replaces all elements for errors list.
        Parameters:
        elements - An iterable of errors elements
        Returns:
        this builder for use in a chained invocation
      • addAllErrors

        @CanIgnoreReturnValue
        public final ImmutableComposerEntity.Builder<A> addAllErrors​(Iterable<? extends io.dialob.api.rest.Response> elements)
        Adds elements to errors list.
        Parameters:
        elements - An iterable of errors elements
        Returns:
        this builder for use in a chained invocation