Class SzEntityIds

All Implemented Interfaces:
Iterable<Long>, Collection<Long>, Set<Long>

public final class SzEntityIds extends AbstractSet<Long>
Provides an unmodifiable runtime-typed Set whose elements are strictly non-null instances of Long entity ID's.
  • Constructor Details

    • SzEntityIds

      public SzEntityIds(Collection<Long> entityIds)
      Constructs with the specified Collection of non-null Long entity ID instances.
      Parameters:
      entityIds - The Collection of Long entity ID instances.
      Throws:
      NullPointerException - If the specified Collection is null or contains null elements.
    • SzEntityIds

      public SzEntityIds()
      Constructs an empty instance with no elements.
    • SzEntityIds

      public SzEntityIds(Long entityId) throws NullPointerException
      Constructs an instance with exactly one entity ID.
      Parameters:
      entityId - The single entity ID for this instance.
      Throws:
      NullPointerException - If the specified parameter is null.
    • SzEntityIds

      public SzEntityIds(Long entityId1, Long entityId2) throws NullPointerException
      Constructs an instance with exactly two entity ID's. If the specified entity ID instances are duplicates of each other then the second will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      Throws:
      NullPointerException - If either of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(Long entityId1, Long entityId2, Long entityId3) throws NullPointerException
      Constructs an instance with exactly three entity ID's. If any of the specified entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(Long entityId1, Long entityId2, Long entityId3, Long entityId4) throws NullPointerException
      Constructs an instance with exactly four entity ID instances. If any of the specified entityr ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5) throws NullPointerException
      Constructs an instance with exactly five entity ID instances. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6) throws NullPointerException
      Constructs an instance with exactly six entity ID instances. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6, Long entityId7) throws NullPointerException
      Constructs an instance with exactly seven entity ID instances. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      entityId7 - The seventh entity ID for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6, Long entityId7, Long entityId8) throws NullPointerException
      Constructs an instance with exactly eight entity ID instances. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      entityId7 - The seventh entity ID for this instance.
      entityId8 - The eighth entity ID for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6, Long entityId7, Long entityId8, Long entityId9) throws NullPointerException
      Constructs an instance with exactly nine entity ID instances. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      entityId7 - The seventh entity ID for this instance.
      entityId8 - The eighth entity ID for this instance.
      entityId9 - The ninth entity ID for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6, Long entityId7, Long entityId8, Long entityId9, Long entityId10) throws NullPointerException
      Constructs an instance with exactly ten entity ID instances. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      entityId7 - The seventh entity ID for this instance.
      entityId8 - The eighth entity ID for this instance.
      entityId9 - The ninth entity ID for this instance.
      entityId10 - The tenth entity ID for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(Long... entityIds) throws NullPointerException
      Constructs an instance with a variable-argument array of Long entity ID instances. This constructor is called when an array is specified or eleven or more variable argument parameters are provided. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityIds - The zero or more Long entity ID instances for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • SzEntityIds

      public SzEntityIds(long... entityIds) throws NullPointerException
      Constructs an instance with a variable-argument array of long entity ID instances. This constructor is called when an array is specified or eleven or more variable argument parameters are provided. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityIds - The zero or more long entity ID instances for this instance.
      Throws:
      NullPointerException - If any of the specified parameters is null.
  • Method Details

    • of

      public static SzEntityIds of(Collection<Long> entityIds)
      Constructs with the specified Collection of non-null Long entity ID instanes. Unlike the SzEntityIds(Collection) constructor, this static factory method allows the parameter to be null, resulting in a null return value.
      Parameters:
      entityIds - The Collection of Long entity ID instances.
      Returns:
      The newly constructed instance of SzEntityIds, or null if the specified parameter is null.
      Throws:
      NullPointerException - If the specified Collection contains null elements.
    • of

      public static SzEntityIds of()
      Constructs an empty instance with no Long entity ID elements.
      Returns:
      The newly constructed instance of SzEntityIds.
    • of

      public static SzEntityIds of(Long entityId) throws NullPointerException
      Constructs an instance with exactly one Long entity ID.
      Parameters:
      entityId - The single entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If the specified parameter is null.
    • of

      public static SzEntityIds of(Long entityId1, Long entityId2) throws NullPointerException
      Constructs an instance with exactly two entity ID's. If the specified Long entity ID instances are duplicates of each other then the second will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If either of the specified parameters is null.
    • of

      public static SzEntityIds of(Long entityId1, Long entityId2, Long entityId3) throws NullPointerException
      Constructs an instance with exactly three entity ID's. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • of

      public static SzEntityIds of(Long entityId1, Long entityId2, Long entityId3, Long entityId4) throws NullPointerException
      Constructs an instance with exactly four entity ID's. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • of

      public static SzEntityIds of(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5) throws NullPointerException
      Constructs an instance with exactly five entity ID's. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • of

      public static SzEntityIds of(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6) throws NullPointerException
      Constructs an instance with exactly six entity ID's. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • of

      public static SzEntityIds of(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6, Long entityId7) throws NullPointerException
      Constructs an instance with exactly seven entity ID's. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      entityId7 - The seventh entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • of

      public static SzEntityIds of(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6, Long entityId7, Long entityId8) throws NullPointerException
      Constructs an instance with exactly eight entity ID's. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      entityId7 - The seventh entity ID for this instance.
      entityId8 - The eighth entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • of

      public static SzEntityIds of(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6, Long entityId7, Long entityId8, Long entityId9) throws NullPointerException
      Constructs an instance with exactly nine entity ID's. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      entityId7 - The seventh entity ID for this instance.
      entityId8 - The eighth entity ID for this instance.
      entityId9 - The ninth entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • of

      public static SzEntityIds of(Long entityId1, Long entityId2, Long entityId3, Long entityId4, Long entityId5, Long entityId6, Long entityId7, Long entityId8, Long entityId9, Long entityId10) throws NullPointerException
      Constructs an instance with exactly ten entity ID's. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.
      Parameters:
      entityId1 - The first entity ID for this instance.
      entityId2 - The second entity ID for this instance.
      entityId3 - The third entity ID for this instance.
      entityId4 - The fourth entity ID for this instance.
      entityId5 - The fifth entity ID for this instance.
      entityId6 - The sixth entity ID for this instance.
      entityId7 - The seventh entity ID for this instance.
      entityId8 - The eighth entity ID for this instance.
      entityId9 - The ninth entity ID for this instance.
      entityId10 - The tenth entity ID for this instance.
      Returns:
      The newly constructed instance of SzEntityIds.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • of

      public static SzEntityIds of(Long... entityIds) throws NullPointerException
      Constructs an instance with a variable-argument array of Long entity ID instances. This static fatory method is called when an array is specified or eleven or more variable argument parameters are provided. If any of the specified Long entity ID instances are duplicated, then the duplicates will be ignored.

      Unlike the SzEntityIds(Long...) constructor, this static factory method allows the parameter to be null, resulting in a null return value.

      Parameters:
      entityIds - The zero or more Long entity ID instances for this instance.
      Returns:
      The newly constructed instance of SzEntityIds, or null if the specified array is null.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • of

      public static SzEntityIds of(long... entityIds) throws NullPointerException
      Constructs an instance with a variable-argument array of long entity ID instances. This static fatory method is called when an array is specified or eleven or more variable argument parameters are provided. If any of the specified long entity ID instances are duplicated, then the duplicates will be ignored.

      Unlike the SzEntityIds(long...) constructor, this static factory method allows the parameter to be null, resulting in a null return value.

      Parameters:
      entityIds - The zero or more Long entity ID instances for this instance.
      Returns:
      The newly constructed instance of SzEntityIds, or null if the specified array is null.
      Throws:
      NullPointerException - If any of the specified parameters is null.
    • newBuilder

      public static SzEntityIds.Builder newBuilder()
      Creates a new SzEntityIds.Builder for creating an instance of SzEntityIds.
      Returns:
      A new SzEntityIds.Builder for creating an instance of SzEntityIds.
    • contains

      public boolean contains(Object element)
      Specified by:
      contains in interface Collection<Long>
      Specified by:
      contains in interface Set<Long>
      Overrides:
      contains in class AbstractCollection<Long>
    • containsAll

      public boolean containsAll(Collection<?> elements)
      Specified by:
      containsAll in interface Collection<Long>
      Specified by:
      containsAll in interface Set<Long>
      Overrides:
      containsAll in class AbstractCollection<Long>
    • iterator

      public Iterator<Long> iterator()
      Specified by:
      iterator in interface Collection<Long>
      Specified by:
      iterator in interface Iterable<Long>
      Specified by:
      iterator in interface Set<Long>
      Specified by:
      iterator in class AbstractCollection<Long>
    • size

      public int size()
      Specified by:
      size in interface Collection<Long>
      Specified by:
      size in interface Set<Long>
      Specified by:
      size in class AbstractCollection<Long>
    • toString

      public String toString()
      Overrides:
      toString in class AbstractCollection<Long>