Top Description Inners Methods
net.bytebuddy.matcher

public Interface FilterableList<T, S extends net.bytebuddy.matcher.FilterableList<T, S>>

extends List<T>
Known Direct Subinterfaces
net.bytebuddy.description.annotation.AnnotationList, net.bytebuddy.description.field.FieldList, net.bytebuddy.description.method.MethodList, net.bytebuddy.description.method.ParameterList, net.bytebuddy.description.type.RecordComponentList, net.bytebuddy.description.type.TypeList, net.bytebuddy.description.type.TypeList.Generic
Known Direct Implementers
net.bytebuddy.matcher.FilterableList.Empty, net.bytebuddy.matcher.FilterableList.AbstractBase
Type Parameters
<T>
The type of the collection's elements.
<S>
The type of this list.
Imports
java.util.AbstractList, .ArrayList, .List

A filterable list allows to use an net.bytebuddy.matcher.ElementMatcher to reduce a lists to elements that are matched by this matcher in this list.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
FilterableList.AbstractBase<
The type of the collection's elements.
T
,
The type of this list.
S extends FilterableList<T, S>
>

A base implementation of a net.bytebuddy.matcher.FilterableList.

public static class
FilterableList.Empty<
The type of the collection's elements.
T
,
The type of this list.
S extends FilterableList<T, S>
>

An implementation of an empty net.bytebuddy.matcher.FilterableList.

Method Summary

Modifier and TypeMethod and Description
public S

Returns:

A new list only containing the matched elements.
filter
(ElementMatcher<? super T>
The element matcher to match the elements of this list against.
elementMatcher
)

Filters any elements in this lists by the given elementMatcher and returns a list that are matched by the given matcher.

public T

Returns:

The only element of this list.
getOnly
()

Returns the only element of this list.

public S
subList(int
low endpoint (inclusive) of the subList
fromIndex
,
int
high endpoint (exclusive) of the subList
toIndex
)

Redeclares java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
Inherited from java.util.List:
addaddaddAlladdAlladdFirstaddLastclearcontainscontainsAllcopyOfequalsgetgetFirstgetLasthashCodeindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorofofofofofofofofofofofofremoveremoveremoveAllremoveFirstremoveLastreplaceAllretainAllreversedsetsizesortspliteratortoArraytoArray

Method Detail

filterback to summary
public S filter(ElementMatcher<? super T> elementMatcher)

Filters any elements in this lists by the given elementMatcher and returns a list that are matched by the given matcher.

Parameters
elementMatcher:ElementMatcher<? super T>

The element matcher to match the elements of this list against.

Returns:S

A new list only containing the matched elements.

getOnlyback to summary
public T getOnly()

Returns the only element of this list. If there is not exactly one element in this list, an java.lang.IllegalStateException is thrown.

Returns:T

The only element of this list.

subListback to summary
public S subList(int fromIndex, int toIndex)

Redeclares java.util.List.subList.

Doc from java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.

This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:

list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.

The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

Parameters
fromIndex:int

low endpoint (inclusive) of the subList

toIndex:int

high endpoint (exclusive) of the subList

Returns:S

a view of the specified range within this list

net.bytebuddy.matcher back to summary

public abstract Class FilterableList.AbstractBase<T, S extends net.bytebuddy.matcher.FilterableList<T, S>>

extends AbstractList<T>
implements FilterableList<T, S extends FilterableList<T, S>>
Class Inheritance
All Implemented Interfaces
net.bytebuddy.matcher.FilterableList, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable
Known Direct Subclasses
net.bytebuddy.description.ByteCodeElement.Token.TokenList, net.bytebuddy.description.annotation.AnnotationList.AbstractBase, net.bytebuddy.description.field.FieldList.AbstractBase, net.bytebuddy.description.method.MethodList.AbstractBase, net.bytebuddy.description.method.ParameterList.AbstractBase, net.bytebuddy.description.type.RecordComponentList.AbstractBase, net.bytebuddy.description.type.TypeList.AbstractBase, net.bytebuddy.description.type.TypeList.Generic.AbstractBase, net.bytebuddy.dynamic.scaffold.MethodGraph.NodeList
Type Parameters
<T>
The type of the collection's elements.
<S>
The type of this list.

A base implementation of a net.bytebuddy.matcher.FilterableList.

Field Summary

Modifier and TypeField and Description
private static final int
ONLY

A convenience variable indicating the index of a list's only variable.

Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public S
filter(ElementMatcher<? super T>
The element matcher to match the elements of this list against.
elementMatcher
)

Implements net.bytebuddy.matcher.FilterableList.filter.

Filters any elements in this lists by the given elementMatcher and returns a list that are matched by the given matcher.
public T
getOnly()

Implements net.bytebuddy.matcher.FilterableList.getOnly.

Returns the only element of this list.
public S
subList(int
low endpoint (inclusive) of the subList
fromIndex
,
int
high endpoint (exclusive) of the subList
toIndex
)

Overrides java.util.AbstractList.subList.

Implements net.bytebuddy.matcher.FilterableList.subList, java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
protected abstract S

Returns:

A wrapped instance of the given values.
wrap
(List<T>
The values to wrap in an instance of this list's type.
values
)

Represents a list of values as an instance of this instance's list type.

Inherited from java.util.AbstractList:
addaddaddAllclearequalsgethashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangeset

Field Detail

ONLYback to summary
private static final int ONLY

A convenience variable indicating the index of a list's only variable.

Constructor Detail

AbstractBaseback to summary
public AbstractBase()

Method Detail

filterback to summary
public S filter(ElementMatcher<? super T> elementMatcher)

Implements net.bytebuddy.matcher.FilterableList.filter.

Doc from net.bytebuddy.matcher.FilterableList.filter.

Filters any elements in this lists by the given elementMatcher and returns a list that are matched by the given matcher.

Parameters
elementMatcher:ElementMatcher<? super T>

The element matcher to match the elements of this list against.

Returns:S

A new list only containing the matched elements.

Annotations
@SuppressWarnings:unchecked
getOnlyback to summary
public T getOnly()

Implements net.bytebuddy.matcher.FilterableList.getOnly.

Doc from net.bytebuddy.matcher.FilterableList.getOnly.

Returns the only element of this list. If there is not exactly one element in this list, an java.lang.IllegalStateException is thrown.

Returns:T

The only element of this list.

subListback to summary
public S subList(int fromIndex, int toIndex)

Overrides java.util.AbstractList.subList.

Implements net.bytebuddy.matcher.FilterableList.subList, java.util.List.subList.

Doc from net.bytebuddy.matcher.FilterableList.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.

This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:

list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.

The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

Parameters
fromIndex:int

Doc from java.util.List.subList.

low endpoint (inclusive) of the subList

toIndex:int

Doc from java.util.List.subList.

high endpoint (exclusive) of the subList

Returns:S

Doc from java.util.List.subList.

a view of the specified range within this list

wrapback to summary
protected abstract S wrap(List<T> values)

Represents a list of values as an instance of this instance's list type.

Parameters
values:List<T>

The values to wrap in an instance of this list's type.

Returns:S

A wrapped instance of the given values.

net.bytebuddy.matcher back to summary

public Class FilterableList.Empty<T, S extends net.bytebuddy.matcher.FilterableList<T, S>>

extends AbstractList<T>
implements FilterableList<T, S extends FilterableList<T, S>>
Class Inheritance
All Implemented Interfaces
net.bytebuddy.matcher.FilterableList, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable
Known Direct Subclasses
net.bytebuddy.description.annotation.AnnotationList.Empty, net.bytebuddy.description.field.FieldList.Empty, net.bytebuddy.description.method.MethodList.Empty, net.bytebuddy.description.method.ParameterList.Empty, net.bytebuddy.description.type.RecordComponentList.Empty, net.bytebuddy.description.type.TypeList.Empty, net.bytebuddy.description.type.TypeList.Generic.Empty
Type Parameters
<T>
The type of the collection's elements.
<S>
The type of this list.

An implementation of an empty net.bytebuddy.matcher.FilterableList.

Field Summary

Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public S
filter(ElementMatcher<? super T>
The element matcher to match the elements of this list against.
elementMatcher
)

Implements net.bytebuddy.matcher.FilterableList.filter.

Filters any elements in this lists by the given elementMatcher and returns a list that are matched by the given matcher.
public T
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
public T
getOnly()

Implements net.bytebuddy.matcher.FilterableList.getOnly.

Returns the only element of this list.
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
public S
subList(int
low endpoint (inclusive) of the subList
fromIndex
,
int
high endpoint (exclusive) of the subList
toIndex
)

Overrides java.util.AbstractList.subList.

Implements net.bytebuddy.matcher.FilterableList.subList, java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangeset

Constructor Detail

Emptyback to summary
public Empty()

Method Detail

filterback to summary
public S filter(ElementMatcher<? super T> elementMatcher)

Implements net.bytebuddy.matcher.FilterableList.filter.

Doc from net.bytebuddy.matcher.FilterableList.filter.

Filters any elements in this lists by the given elementMatcher and returns a list that are matched by the given matcher.

Parameters
elementMatcher:ElementMatcher<? super T>

The element matcher to match the elements of this list against.

Returns:S

A new list only containing the matched elements.

Annotations
@SuppressWarnings:unchecked
getback to summary
public T get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:T

the element at the specified position in this list

getOnlyback to summary
public T getOnly()

Implements net.bytebuddy.matcher.FilterableList.getOnly.

Doc from net.bytebuddy.matcher.FilterableList.getOnly.

Returns the only element of this list. If there is not exactly one element in this list, an java.lang.IllegalStateException is thrown.

Returns:T

The only element of this list.

sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

subListback to summary
public S subList(int fromIndex, int toIndex)

Overrides java.util.AbstractList.subList.

Implements net.bytebuddy.matcher.FilterableList.subList, java.util.List.subList.

Doc from net.bytebuddy.matcher.FilterableList.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.

This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:

list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.

The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

Parameters
fromIndex:int

Doc from java.util.List.subList.

low endpoint (inclusive) of the subList

toIndex:int

Doc from java.util.List.subList.

high endpoint (exclusive) of the subList

Returns:S

Doc from java.util.List.subList.

a view of the specified range within this list

Annotations
@SuppressWarnings:unchecked