Package net.bytebuddy.matcher
Class FilterableList.Empty<T,S extends FilterableList<T,S>>
java.lang.Object
java.util.AbstractCollection<T>
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:
Iterable<T>
,Collection<T>
,List<T>
,SequencedCollection<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 AbstractList<T>
implements FilterableList<T,S>
An implementation of an empty
FilterableList
.-
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>> -
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilter
(ElementMatcher<? super T> elementMatcher) Filters any elements in this lists by the givenelementMatcher
and returns a list that are matched by the given matcher.get
(int index) getOnly()
Returns the only element of this list.int
size()
subList
(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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, sort, spliterator, toArray, toArray
-
Constructor Details
-
Empty
public Empty()
-
-
Method Details
-
get
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in classAbstractCollection<T>
-
getOnly
Returns the only element of this list. If there is not exactly one element in this list, anIllegalStateException
is thrown.- Specified by:
getOnly
in interfaceFilterableList<T,
S extends FilterableList<T, S>> - Returns:
- The only element of this list.
-
filter
Filters any elements in this lists by the givenelementMatcher
and returns a list that are matched by the given matcher.- Specified by:
filter
in 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
- Specified by:
subList
in interfaceFilterableList<T,
S extends FilterableList<T, S>> - Specified by:
subList
in interfaceList<T>
- Overrides:
subList
in classAbstractList<T>
-