Class ImmutableOperations.Builder

  • Enclosing class:
    ImmutableOperations

    @NotThreadSafe
    public static final class ImmutableOperations.Builder
    extends Object
    Builds instances of type ImmutableOperations. 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 ImmutableOperations.Builder from​(Operations instance)
        Fill a builder with attribute values from the provided Operations 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
      • commitMeta

        @CanIgnoreReturnValue
        public final ImmutableOperations.Builder commitMeta​(CommitMeta commitMeta)
        Initializes the value for the commitMeta attribute.
        Parameters:
        commitMeta - The value for commitMeta
        Returns:
        this builder for use in a chained invocation
      • addOperations

        @CanIgnoreReturnValue
        public final ImmutableOperations.Builder addOperations​(Operation element)
        Adds one element to operations list.
        Parameters:
        element - A operations element
        Returns:
        this builder for use in a chained invocation
      • addOperations

        @CanIgnoreReturnValue
        public final ImmutableOperations.Builder addOperations​(Operation... elements)
        Adds elements to operations list.
        Parameters:
        elements - An array of operations elements
        Returns:
        this builder for use in a chained invocation
      • operations

        @CanIgnoreReturnValue
        public final ImmutableOperations.Builder operations​(Iterable<? extends Operation> elements)
        Sets or replaces all elements for operations list.
        Parameters:
        elements - An iterable of operations elements
        Returns:
        this builder for use in a chained invocation
      • addAllOperations

        @CanIgnoreReturnValue
        public final ImmutableOperations.Builder addAllOperations​(Iterable<? extends Operation> elements)
        Adds elements to operations list.
        Parameters:
        elements - An iterable of operations elements
        Returns:
        this builder for use in a chained invocation