Class MarshallableSet<T>

java.lang.Object
org.infinispan.marshall.protostream.impl.MarshallableSet<T>

@ProtoTypeId(23) public class MarshallableSet<T> extends Object
A wrapper for a Set of objects whose type is unknown until runtime. This is equivalent to utilising a Set without the overhead of creating a MarshallableObject per entry.
Since:
16.0
Author:
Ryan Emerson
  • Method Details

    • create

      public static <T> MarshallableSet<T> create(Set<T> set)
      Parameters:
      set - the Set to be wrapped.
      Returns:
      a new MarshallableSet instance containing the passed object if the object is not null, otherwise null.
    • unwrap

      public static <T> Set<T> unwrap(MarshallableSet<T> wrapper)
      Parameters:
      wrapper - the MarshallableSet instance to unwrap.
      Returns:
      the wrapped Set or null if the provided wrapper does not exist.
    • unwrap

      public static <R extends Set<T>, T> R unwrap(MarshallableSet<T> wrapper, Function<Set<T>,R> builder)
    • get

      public Set<T> get()