Class Constraints.ConstrainedSet<E>

    • Field Detail

      • delegate

        private final java.util.Set<E> delegate
      • constraint

        private final Constraint<? super E> constraint
    • Constructor Detail

      • ConstrainedSet

        public ConstrainedSet​(java.util.Set<E> delegate,
                              Constraint<? super E> constraint)
    • Method Detail

      • delegate

        protected java.util.Set<E> delegate()
        Description copied from class: ForwardingObject
        Returns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such as ForwardingSet.delegate(). Concrete subclasses override this method to supply the instance being decorated.
        Specified by:
        delegate in class ForwardingSet<E>
      • add

        public boolean add​(E element)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.Set<E>
        Overrides:
        add in class ForwardingCollection<E>
      • addAll

        public boolean addAll​(java.util.Collection<? extends E> elements)
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.Set<E>
        Overrides:
        addAll in class ForwardingCollection<E>