net.corda.core.utilities

## Class NonEmptySet<T>

- net.corda.core.utilities.NonEmptySet<T>

-     public class NonEmptySet<T>

  A set which is constrained to ensure it can never be empty. An initial value must be provided at construction, and attempting to remove the last element will cause an IllegalStateException. The underlying set is exposed for Kryo to access, but should not be accessed directly.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `NonEmptySet.Iterator<T>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NonEmptySet(T initial)` A set which is constrained to ensure it can never be empty. An initial value must be provided at construction, and attempting to remove the last element will cause an IllegalStateException. The underlying set is exposed for Kryo to access, but should not be accessed directly.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(T element)`
    `boolean` | `addAll(java.util.Collection<? extends T> elements)`
    `java.lang.Void` | `clear()`
    `boolean` | `contains(java.lang.Object element)`
    `boolean` | `containsAll(java.util.Collection<? extends java.lang.Object> elements)`
    `boolean` | `equals(java.lang.Object other)`
    `int` | `getSize()`
    `int` | `hashCode()`
    `boolean` | `isEmpty()`
    `java.util.Iterator<T>` | `iterator()`
    `boolean` | `remove(java.lang.Object element)`
    `boolean` | `removeAll(java.util.Collection<? extends java.lang.Object> elements)`
    `boolean` | `retainAll(java.util.Collection<? extends java.lang.Object> elements)`
    `int` | `size()`
    `java.lang.Object[]` | `toArray()`
    `<T> T[]` | `toArray(T[] p)`
    `java.lang.String` | `toString()`

- - ### Constructor Detail

    - #### NonEmptySet

          public NonEmptySet(T initial)

      A set which is constrained to ensure it can never be empty. An initial value must be provided at construction, and attempting to remove the last element will cause an IllegalStateException. The underlying set is exposed for Kryo to access, but should not be accessed directly.

  - ### Method Detail

    - #### getSize

          public int getSize()

    - #### size

          public int size()

    - #### add

          public boolean add(T element)

    - #### addAll

          public boolean addAll(java.util.Collection<? extends T> elements)

    - #### clear

          public java.lang.Void clear()

    - #### contains

          public boolean contains(java.lang.Object element)

    - #### containsAll

          public boolean containsAll(java.util.Collection<? extends java.lang.Object> elements)

    - #### isEmpty

          public boolean isEmpty()

    - #### iterator

          public java.util.Iterator<T> iterator()

    - #### remove

          public boolean remove(java.lang.Object element)

    - #### removeAll

          public boolean removeAll(java.util.Collection<? extends java.lang.Object> elements)

    - #### retainAll

          public boolean retainAll(java.util.Collection<? extends java.lang.Object> elements)

    - #### equals

          public boolean equals(java.lang.Object other)

    - #### hashCode

          public int hashCode()

    - #### toString

          public java.lang.String toString()

    - #### toArray

          public java.lang.Object[] toArray()

    - #### toArray

          public <T> T[] toArray(T[] p)