public class FieldStream
extends java.lang.Object
| Constructor and Description |
|---|
FieldStream(RStream parent,
boolean withSuper) |
| Modifier and Type | Method and Description |
|---|---|
FieldWrapper |
by(int index)
Get the
FieldWrapper instance of the field with the given index |
FieldWrapper |
by(java.lang.String name)
Get the
FieldWrapper instance of the field with the given name |
FieldStream |
filter(boolean isStatic)
Filter out all static/non-static fields
|
FieldStream |
filter(java.lang.Class<?> clazz)
Filter out all fields whose type is not the given
Class |
FieldStream |
filter(java.util.function.Predicate<FieldWrapper> filter)
Filter the fields by the given predicate
|
FieldStream |
forEach(java.util.function.Consumer<FieldWrapper> consumer)
Loop through all
FieldWrapper instances |
java.util.Iterator<FieldWrapper> |
iterator()
Get an iterator of the
FieldWrapper instances |
java.util.stream.Stream<FieldWrapper> |
jstream()
Get the java stream of the
FieldWrapper instances |
RStream |
parent()
Get the parent
RStream instance |
int |
size()
Get the amount of fields in this stream
|
public FieldStream(RStream parent, boolean withSuper)
public int size()
public FieldWrapper by(java.lang.String name)
FieldWrapper instance of the field with the given namename - The name of the fieldFieldWrapper instancejava.lang.NoSuchFieldException - If the field doesn't existpublic FieldWrapper by(int index)
FieldWrapper instance of the field with the given indexindex - The index of the fieldFieldWrapper instancejava.lang.NoSuchFieldException - If the index is out of boundspublic FieldStream filter(java.util.function.Predicate<FieldWrapper> filter)
filter - The predicateFieldStreampublic FieldStream filter(java.lang.Class<?> clazz)
Classclazz - The Class of the field typeFieldStreampublic FieldStream filter(boolean isStatic)
isStatic - Whether the field should be static or notFieldStreampublic java.util.Iterator<FieldWrapper> iterator()
FieldWrapper instancespublic java.util.stream.Stream<FieldWrapper> jstream()
FieldWrapper instancespublic FieldStream forEach(java.util.function.Consumer<FieldWrapper> consumer)
FieldWrapper instancesconsumer - The consumerFieldStream