Package net.bytebuddy.matcher
Interface FilterableList<T,S extends FilterableList<T,S>>
-
- Type Parameters:
T
- The type of the collection's elements.S
- The type of this list.
- All Superinterfaces:
Collection<T>
,Iterable<T>
,List<T>
- All Known Subinterfaces:
AnnotationList
,FieldList<T>
,MethodList<T>
,ParameterList<T>
,RecordComponentList<T>
,TypeList
,TypeList.Generic
- All Known Implementing Classes:
AnnotationList.AbstractBase
,AnnotationList.Empty
,AnnotationList.Explicit
,AnnotationList.ForLoadedAnnotations
,ByteCodeElement.Token.TokenList
,FieldList.AbstractBase
,FieldList.Empty
,FieldList.Explicit
,FieldList.ForLoadedFields
,FieldList.ForTokens
,FieldList.TypeSubstituting
,FilterableList.AbstractBase
,FilterableList.Empty
,MethodGraph.NodeList
,MethodList.AbstractBase
,MethodList.Empty
,MethodList.Explicit
,MethodList.ForLoadedMethods
,MethodList.ForTokens
,MethodList.TypeSubstituting
,ParameterList.AbstractBase
,ParameterList.Empty
,ParameterList.Explicit
,ParameterList.Explicit.ForTypes
,ParameterList.ForLoadedExecutable
,ParameterList.ForLoadedExecutable.OfConstructor
,ParameterList.ForLoadedExecutable.OfLegacyVmConstructor
,ParameterList.ForLoadedExecutable.OfLegacyVmMethod
,ParameterList.ForLoadedExecutable.OfMethod
,ParameterList.ForTokens
,ParameterList.TypeSubstituting
,RecordComponentList.AbstractBase
,RecordComponentList.Empty
,RecordComponentList.Explicit
,RecordComponentList.ForLoadedRecordComponents
,RecordComponentList.ForTokens
,RecordComponentList.TypeSubstituting
,Transformer.ForMethod.TransformedMethod.TransformedParameterList
,TypeDescription.Generic.LazyProjection.WithLazyNavigation.LazyInterfaceList
,TypeDescription.Generic.OfParameterizedType.ForLoadedType.ParameterArgumentTypeList
,TypeDescription.Generic.OfTypeVariable.ForLoadedType.TypeVariableBoundList
,TypeDescription.Generic.OfWildcardType.ForLoadedType.WildcardLowerBoundTypeList
,TypeDescription.Generic.OfWildcardType.ForLoadedType.WildcardUpperBoundTypeList
,TypeDescription.SuperTypeLoading.ClassLoadingTypeList
,TypeList.AbstractBase
,TypeList.Empty
,TypeList.Explicit
,TypeList.ForLoadedTypes
,TypeList.Generic.AbstractBase
,TypeList.Generic.Empty
,TypeList.Generic.Explicit
,TypeList.Generic.ForDetachedTypes
,TypeList.Generic.ForDetachedTypes.OfTypeVariables
,TypeList.Generic.ForDetachedTypes.WithResolvedErasure
,TypeList.Generic.ForLoadedTypes
,TypeList.Generic.ForLoadedTypes.OfTypeVariables
,TypeList.Generic.OfConstructorExceptionTypes
,TypeList.Generic.OfLoadedInterfaceTypes
,TypeList.Generic.OfMethodExceptionTypes
,TypePool.Default.LazyTypeDescription.FieldTokenList
,TypePool.Default.LazyTypeDescription.GenericTypeToken.ForTypeVariable.Formal.LazyTypeVariable.LazyBoundTokenList
,TypePool.Default.LazyTypeDescription.GenericTypeToken.LazyTokenList
,TypePool.Default.LazyTypeDescription.GenericTypeToken.LazyTokenList.ForWildcardBound
,TypePool.Default.LazyTypeDescription.GenericTypeToken.Resolution.Raw.RawAnnotatedType.LazyRawAnnotatedTypeList
,TypePool.Default.LazyTypeDescription.LazyNestMemberList
,TypePool.Default.LazyTypeDescription.LazyTypeList
,TypePool.Default.LazyTypeDescription.MethodTokenList
,TypePool.Default.LazyTypeDescription.RecordComponentTokenList
,TypePool.Default.LazyTypeDescription.TokenizedGenericType.Malformed.TokenList
,TypePool.Default.LazyTypeDescription.TokenizedGenericType.TokenList
,TypePool.Default.LazyTypeDescription.TokenizedGenericType.TypeVariableList
,TypeWriter.Default.ForInlining.WithDecorationOnly.LazyFieldList
public interface FilterableList<T,S extends FilterableList<T,S>> extends List<T>
A filterable list allows to use anElementMatcher
to reduce a lists to elements that are matched by this matcher in this list.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
FilterableList.AbstractBase<T,S extends FilterableList<T,S>>
A base implementation of aFilterableList
.static class
FilterableList.Empty<T,S extends FilterableList<T,S>>
An implementation of an emptyFilterableList
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description S
filter(ElementMatcher<? super T> elementMatcher)
Filters any elements in this lists by the givenelementMatcher
and returns a list that are matched by the given matcher.T
getOnly()
Returns the only element of this list.S
subList(int fromIndex, int toIndex)
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
filter
S filter(ElementMatcher<? super T> elementMatcher)
Filters any elements in this lists by the givenelementMatcher
and returns a list that are matched by the given matcher.- Parameters:
elementMatcher
- The element matcher to match the elements of this list against.- Returns:
- A new list only containing the matched elements.
-
getOnly
T getOnly()
Returns the only element of this list. If there is not exactly one element in this list, anIllegalStateException
is thrown.- Returns:
- The only element of this list.
-
-