Class MarshallableArray<T>

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

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

    • create

      public static <T> MarshallableArray<T> create(T[] entries)
      Parameters:
      entries - an array to be wrapped as a MarshallableArray.
      Returns:
      a new MarshallableArray instance containing the passed object if the array is not null, otherwise null.
    • unwrap

      public static <T> T[] unwrap(MarshallableArray<T> wrapper)
      Parameters:
      wrapper - the MarshallableArray instance to unwrap
      Returns:
      the wrapped array or null if the provided wrapper does not exist
    • unwrap

      public static <T> T[] unwrap(MarshallableArray<T> wrapper, T[] dest)
      Parameters:
      wrapper - the MarshallableArray instance to unwrap
      dest - an array into which the array entries should be copied
      Returns:
      the wrapped array or null if the provided wrapper does not exist
    • get

      public Object[] get()