Class ForwardingList<E>

All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>, SequencedCollection<E>

@GwtCompatible @Deprecated(since="2022-12-01") public abstract class ForwardingList<E> extends ForwardingCollection<E> implements List<E>
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
A list which forwards all its method calls to another list. Subclasses should override one or more methods to modify the behavior of the backing list as desired per the decorator pattern.

This class does not implement RandomAccess. If the delegate supports random access, the ForwardingList subclass should implement the RandomAccess interface.

Warning: The methods of ForwardingList forward indiscriminately to the methods of the delegate. For example, overriding add(int, E) alone will not change the behavior of addAll(int, java.util.Collection<? extends E>), which can lead to unexpected behavior. In this case, you should override addAll as well, either providing your own implementation, or delegating to the provided standardAddAll method.

The standard methods and any collection views they return are not guaranteed to be thread-safe, even when all of the methods that they depend on are thread-safe.

Since:
2.0 (imported from Google Collections Library)
  • Method Details

    • add

      public void add(int index, E element)
      Deprecated.
      Specified by:
      add in interface List<E>
    • addAll

      public boolean addAll(int index, Collection<? extends E> elements)
      Deprecated.
      Specified by:
      addAll in interface List<E>
    • get

      public E get(int index)
      Deprecated.
      Specified by:
      get in interface List<E>
    • indexOf

      public int indexOf(Object element)
      Deprecated.
      Specified by:
      indexOf in interface List<E>
    • lastIndexOf

      public int lastIndexOf(Object element)
      Deprecated.
      Specified by:
      lastIndexOf in interface List<E>
    • listIterator

      public ListIterator<E> listIterator()
      Deprecated.
      Specified by:
      listIterator in interface List<E>
    • listIterator

      public ListIterator<E> listIterator(int index)
      Deprecated.
      Specified by:
      listIterator in interface List<E>
    • remove

      public E remove(int index)
      Deprecated.
      Specified by:
      remove in interface List<E>
    • set

      public E set(int index, E element)
      Deprecated.
      Specified by:
      set in interface List<E>
    • subList

      public List<E> subList(int fromIndex, int toIndex)
      Deprecated.
      Specified by:
      subList in interface List<E>
    • equals

      public boolean equals(@Nullable Object object)
      Deprecated.
      Specified by:
      equals in interface Collection<E>
      Specified by:
      equals in interface List<E>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Deprecated.
      Specified by:
      hashCode in interface Collection<E>
      Specified by:
      hashCode in interface List<E>
      Overrides:
      hashCode in class Object