Class ImmutableErrors.Builder

  • Enclosing class:
    ImmutableErrors

    @NotThreadSafe
    public static final class ImmutableErrors.Builder
    extends Object
    Builds instances of type ImmutableErrors. 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

        public final ImmutableErrors.Builder from​(Errors instance)
        Fill a builder with attribute values from the provided Errors 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
      • timestamp

        public final ImmutableErrors.Builder timestamp​(Date timestamp)
        Initializes the value for the timestamp attribute.

        If not set, this attribute will have a default value as returned by the initializer of timestamp.

        Parameters:
        timestamp - The value for timestamp (can be null)
        Returns:
        this builder for use in a chained invocation
      • status

        public final ImmutableErrors.Builder status​(Integer status)
        Initializes the value for the status attribute.
        Parameters:
        status - The value for status (can be null)
        Returns:
        this builder for use in a chained invocation
      • error

        public final ImmutableErrors.Builder error​(String error)
        Initializes the value for the error attribute.
        Parameters:
        error - The value for error (can be null)
        Returns:
        this builder for use in a chained invocation
      • message

        public final ImmutableErrors.Builder message​(String message)
        Initializes the value for the message attribute.
        Parameters:
        message - The value for message (can be null)
        Returns:
        this builder for use in a chained invocation
      • trace

        public final ImmutableErrors.Builder trace​(String trace)
        Initializes the value for the trace attribute.
        Parameters:
        trace - The value for trace (can be null)
        Returns:
        this builder for use in a chained invocation
      • path

        public final ImmutableErrors.Builder path​(String path)
        Initializes the value for the path attribute.
        Parameters:
        path - The value for path (can be null)
        Returns:
        this builder for use in a chained invocation
      • addErrors

        public final ImmutableErrors.Builder addErrors​(Errors.Error element)
        Adds one element to errors list.
        Parameters:
        element - A errors element
        Returns:
        this builder for use in a chained invocation
      • addErrors

        public final ImmutableErrors.Builder addErrors​(Errors.Error... elements)
        Adds elements to errors list.
        Parameters:
        elements - An array of errors elements
        Returns:
        this builder for use in a chained invocation
      • errors

        public final ImmutableErrors.Builder errors​(Iterable<? extends Errors.Error> 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

        public final ImmutableErrors.Builder addAllErrors​(Iterable<? extends Errors.Error> elements)
        Adds elements to errors list.
        Parameters:
        elements - An iterable of errors elements
        Returns:
        this builder for use in a chained invocation