Class ImmutableArray<T>

java.lang.Object
com.landawn.abacus.util.ImmutableArray<T>
All Implemented Interfaces:
Immutable

@Immutable public final class ImmutableArray<T> extends Object implements Immutable
  • Method Details

    • of

      public static <T> ImmutableArray<T> of(T e1)
    • of

      public static <T> ImmutableArray<T> of(T e1, T e2)
    • of

      public static <T> ImmutableArray<T> of(T e1, T e2, T e3)
    • of

      public static <T> ImmutableArray<T> of(T e1, T e2, T e3, T e4)
    • of

      public static <T> ImmutableArray<T> of(T e1, T e2, T e3, T e4, T e5)
    • of

      public static <T> ImmutableArray<T> of(T e1, T e2, T e3, T e4, T e5, T e6)
    • of

      public static <T> ImmutableArray<T> of(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
    • copyOf

      public static <T> ImmutableArray<T> copyOf(T[] elements)
    • wrap

      @Deprecated public static <T> ImmutableArray<T> wrap(T[] elements)
      Deprecated.
      the ImmutableArray may be modified through the specified elements
      Type Parameters:
      T -
      Parameters:
      elements -
      Returns:
      an ImmutableArray backed by the specified elements
    • length

      public int length()
    • isEmpty

      public boolean isEmpty()
    • get

      public T get(int index)
    • indexOf

      public int indexOf(T valueToFind)
    • lastIndexOf

      public int lastIndexOf(T valueToFind)
    • contains

      public boolean contains(T valueToFind)
    • forEach

      public <E extends Exception> void forEach(Throwables.Consumer<T,E> consumer) throws E
      Throws:
      E extends Exception
    • forEachIndexed

      public <E extends Exception> void forEachIndexed(Throwables.IndexedConsumer<T,E> consumer) throws E
      Throws:
      E extends Exception
    • stream

      public Stream<T> stream()
    • copy

      public ImmutableArray<T> copy(int fromIndex, int toIndex)
    • asList

      public ImmutableList<T> asList()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object