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:
java.util.Collection<T>,java.lang.Iterable<T>,java.util.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.ForLoadedType.ClassDescriptionTypeList,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.LazyMethodDescription.LazyParameterizedReceiverType.TypeArgumentList,TypePool.Default.LazyTypeDescription.LazyMethodDescription.LazyParameterList,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 java.util.List<T>A filterable list allows to use anElementMatcherto 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 classFilterableList.AbstractBase<T,S extends FilterableList<T,S>>A base implementation of aFilterableList.static classFilterableList.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 Sfilter(ElementMatcher<? super T> elementMatcher)Filters any elements in this lists by the givenelementMatcherand returns a list that are matched by the given matcher.TgetOnly()Returns the only element of this list.SsubList(int fromIndex, int toIndex)
-
-
-
Method Detail
-
filter
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.- 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, anIllegalStateExceptionis thrown.- Returns:
- The only element of this list.
-
-