Class ExcludedSet<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.apache.sis.internal.metadata.ExcludedSet<E>
Type Parameters:
E - the type of elements that the collection would have if it was non-empty.
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, Set<E>

public final class ExcludedSet<E> extends AbstractSet<E> implements Serializable
A unmodifiable empty set with a customized exception message thrown by the add(Object) method. This set is used only for mutually exclusive properties, when a collection cannot have elements because the other property is set.
Since:
0.3
Version:
0.3
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • name1

      private final String name1
      The name of the mutually exclusive properties.
    • name2

      private final String name2
      The name of the mutually exclusive properties.
  • Constructor Details

    • ExcludedSet

      public ExcludedSet(String name1, String name2)
      Creates a new empty set.
      Parameters:
      name1 - the name of the first mutually exclusive property.
      name2 - the name of the second mutually exclusive property.
  • Method Details