Package net.bytebuddy.matcher
Class FilterableList.Empty<T,S extends FilterableList<T,S>>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- net.bytebuddy.matcher.FilterableList.Empty<T,S>
-
- Type Parameters:
T- The type of the collection's elements.S- The type of this list.
- All Implemented Interfaces:
java.lang.Iterable<T>,java.util.Collection<T>,java.util.List<T>,FilterableList<T,S>
- Direct Known Subclasses:
AnnotationList.Empty,FieldList.Empty,MethodList.Empty,ParameterList.Empty,RecordComponentList.Empty,TypeList.Empty,TypeList.Generic.Empty
- Enclosing interface:
- FilterableList<T,S extends FilterableList<T,S>>
public static class FilterableList.Empty<T,S extends FilterableList<T,S>> extends java.util.AbstractList<T> implements FilterableList<T,S>
An implementation of an emptyFilterableList.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.FilterableList
FilterableList.AbstractBase<T,S extends FilterableList<T,S>>, FilterableList.Empty<T,S extends FilterableList<T,S>>
-
-
Constructor Summary
Constructors Constructor Description Empty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sfilter(ElementMatcher<? super T> elementMatcher)Filters any elements in this lists by the givenelementMatcherand returns a list that are matched by the given matcher.Tget(int index)TgetOnly()Returns the only element of this list.intsize()SsubList(int fromIndex, int toIndex)-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Method Detail
-
get
public T get(int index)
-
size
public int size()
-
getOnly
public T getOnly()
Returns the only element of this list. If there is not exactly one element in this list, anIllegalStateExceptionis thrown.- Specified by:
getOnlyin interfaceFilterableList<T,S extends FilterableList<T,S>>- Returns:
- The only element of this list.
-
filter
public S filter(ElementMatcher<? super T> elementMatcher)
Filters any elements in this lists by the givenelementMatcherand returns a list that are matched by the given matcher.- Specified by:
filterin interfaceFilterableList<T,S extends FilterableList<T,S>>- Parameters:
elementMatcher- The element matcher to match the elements of this list against.- Returns:
- A new list only containing the matched elements.
-
subList
public S subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceFilterableList<T,S extends FilterableList<T,S>>- Specified by:
subListin interfacejava.util.List<T>- Overrides:
subListin classjava.util.AbstractList<T>
-
-