Class FailureItems

  • All Implemented Interfaces:
    Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class FailureItems
    extends Object
    implements org.joda.beans.ImmutableBean, 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​(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
      • combinedWith

        public FailureItems combinedWith​(FailureItems other)
        Combines these failure items with other failure items.
        Parameters:
        other - the other failure items
        Returns:
        the combined failure items
      • combinedWith

        public FailureItems combinedWith​(FailureItem... otherFailures)
        Combines these failure items with other failure items.
        Parameters:
        otherFailures - the other failure items
        Returns:
        the combined failure items
      • combinedWith

        public FailureItems combinedWith​(List<FailureItem> otherFailures)
        Combines these failure items with other failure items.
        Parameters:
        otherFailures - the other failure items
        Returns:
        the combined failure items
      • isEmpty

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

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

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

        public FailureItems.Meta metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • getFailures

        public ImmutableList<FailureItem> getFailures()
        Gets the failures.
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object