Class FailureItems

  • All Implemented Interfaces:
    java.io.Serializable, Bean, ImmutableBean

    public final class FailureItems
    extends java.lang.Object
    implements ImmutableBean, java.io.Serializable
    A list of failure items.

    This provides a wrapper around a list of FailureItem.

    This could be used with Pair to create an object that handles partial success/failure, such as Pair<List<String>, FailureItems>. However, from v1.1.1 ValueWithFailures captures that use case better.

    See Also:
    Serialized Form
    • Field Detail

      • EMPTY

        public static final FailureItems EMPTY
        An empty failure list.
    • Method Detail

      • of

        public static FailureItems of​(FailureItem... failures)
        Creates an instance from the list of failures.
        Parameters:
        failures - the failures
        Returns:
        the failure items
      • of

        public static FailureItems of​(java.util.List<FailureItem> failures)
        Creates an instance from the list of failures.
        Parameters:
        failures - the failures
        Returns:
        the failure items
      • builder

        public static FailureItemsBuilder builder()
        Creates a builder to create the list of failures.
        Returns:
        a builder
      • isEmpty

        public boolean isEmpty()
        Checks if the list of failures is empty.
        Returns:
        true if there are no failures
      • toString

        public java.lang.String toString()
        Returns a string summary of the failures, as a single line excluding the stack traces.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the summary string
      • meta

        public static FailureItems.Meta meta()
        The meta-bean for FailureItems.
        Returns:
        the meta-bean, not null
      • getFailures

        public com.google.common.collect.ImmutableList<FailureItem> getFailures()
        Gets the failures.
        Returns:
        the value of the property, not null
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object