Interface GSet<T>

  • Type Parameters:
    T - The value of the set elements
    All Superinterfaces:
    java.util.Collection<T>, Crdt, java.lang.Iterable<T>, java.util.Set<T>

    public interface GSet<T>
    extends Crdt, java.util.Set<T>
    A Grow-only Set.

    A Grow-only Set can have elements added to it, but cannot have elements removed from it.

    Care needs to be taken to ensure that the serialized value of elements in the set is stable. For example, if using protobufs, the serialized value of any maps contain in the protobuf is not stable, and can yield a different set of bytes for the same logically equal element. Hence maps, should be avoided. Additionally, some changes in protobuf schemas which are backwards compatible from a protobuf perspective, such as changing from sint32 to int32, do result in different serialized bytes, and so must be avoided.

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default boolean remove​(java.lang.Object o)
      Remove is not support on a Grow-only set.
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

      • Methods inherited from interface java.util.Set

        add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, spliterator, toArray, toArray
    • Method Detail

      • remove

        default boolean remove​(java.lang.Object o)
        Remove is not support on a Grow-only set.
        Specified by:
        remove in interface java.util.Collection<T>
        Specified by:
        remove in interface java.util.Set<T>