FieldFinder

Helper for finding field(s) in the class or collection.

Types

Link copied to clipboard
object -Static

Properties

Link copied to clipboard
open override val name: String

Functions

Link copied to clipboard

Concatenate with another finder.

Concatenate with another array.

Concatenate with another iterable.

Concatenate with another sequence.

Link copied to clipboard
fun filter(filter: Field.() -> Boolean): FieldFinder

Filter with a predicate.

Link copied to clipboard
fun filterByModifiers(predicate: (modifiers: Int) -> Boolean): FieldFinder

Use condition to filter by the modifiers.

Filter by the same modifiers.

Link copied to clipboard

Filter by field name.

Link copied to clipboard

Filter by field type.

Link copied to clipboard

Filter exclude the modifiers.

Link copied to clipboard

Filter if they are final.

Link copied to clipboard

Filter include the modifiers.

Link copied to clipboard

Filter if they are non-final.

Link copied to clipboard

Filter if they are non-package-private.

Link copied to clipboard

Filter if they are non-private.

Link copied to clipboard

Filter if they are non-protected.

Link copied to clipboard

Filter if they are non-public.

Link copied to clipboard

Filter if they are non-static.

Link copied to clipboard

Filter if they are package-private.

Link copied to clipboard

Filter if they are private.

Link copied to clipboard

Filter if they are protected.

Link copied to clipboard

Filter if they are public.

Link copied to clipboard

Filter if they are static.

Link copied to clipboard
open override fun findSuper(untilPredicate: Class<*>.() -> Boolean?): FieldFinder

Contact the field sequence in super classes. Only effect when the finder created from a class.

Link copied to clipboard
override fun first(): Field

Get the first element or throw an exception if there is no such element.

override fun first(condition: Field.() -> Boolean): Field

Get the first element by condition or throw an exception if there is no such element.

Link copied to clipboard
override fun firstOrNull(): Field?

Get the first element or null if not found.

override fun firstOrNull(condition: Field.() -> Boolean): Field?

Get the first element by condition or null if not found

Link copied to clipboard
fun forEach(action: (Field) -> Unit)

For-each loop for.

Link copied to clipboard
fun forEachIndexed(action: (index: Int, Field) -> Unit)

For-each loop with index for.

Link copied to clipboard
override fun last(): Field

Get the last element or throw an exception if there is no such element.

override fun last(condition: Field.() -> Boolean): Field

Get the last element by condition or throw an exception if there is no such element.

Link copied to clipboard
override fun lastOrNull(): Field?

Get the last element or null if not found.

override fun lastOrNull(condition: Field.() -> Boolean): Field?

Get the last element by condition or null if not found

Link copied to clipboard
fun <R, C : MutableCollection<in R>> mapToCollection(destination: C, transform: (Field) -> R): C

Map to the collection.

Link copied to clipboard
fun <R> mapToHashSet(transform: (Field) -> R): HashSet<R>

Map to the hashset.

Link copied to clipboard
fun <R> mapToList(transform: (Field) -> R): List<R>

Map to the list.

Link copied to clipboard
fun <R> mapToMutableList(transform: (Field) -> R): List<R>

Map to the mutable list.

Link copied to clipboard
fun <R> mapToMutableSet(transform: (Field) -> R): MutableSet<R>

Map to the mutable set.

Link copied to clipboard
fun <R> mapToSet(transform: (Field) -> R): Set<R>

Map to the set.

Link copied to clipboard
fun onEach(action: (Field) -> Unit): FieldFinder

On-each loop for.

Link copied to clipboard
fun onEachIndexed(action: (index: Int, Field) -> Unit): FieldFinder

On-each loop with index for.

Link copied to clipboard
operator fun plus(other: BaseFinder<Field, FieldFinder>): FieldFinder
operator fun plus(other: Array<Field>): FieldFinder
operator fun plus(other: Iterable<Field>): FieldFinder
operator fun plus(other: Sequence<Field>): FieldFinder
Link copied to clipboard
operator fun plusAssign(other: BaseFinder<Field, FieldFinder>)
operator fun plusAssign(other: Array<Field>)
operator fun plusAssign(other: Iterable<Field>)
operator fun plusAssign(other: Sequence<Field>)
Link copied to clipboard
fun requireCount(condition: Field.() -> Boolean, count: Int): FieldFinder
fun requireCount(condition: Field.() -> Boolean, range: IntRange): FieldFinder
Link copied to clipboard
Link copied to clipboard

Check sequence only has one element.

fun requireSingle(condition: Field.() -> Boolean): FieldFinder
Link copied to clipboard

Check sequence only has one element or null if not found.

Link copied to clipboard
override fun single(): Field

Get the single element or throw an exception if there is no such element or more than one element.

override fun single(condition: Field.() -> Boolean): Field
Link copied to clipboard
override fun singleOrNull(): Field?

Get the single element or null if not found.

override fun singleOrNull(condition: Field.() -> Boolean): Field?
Link copied to clipboard
fun <C : MutableCollection<Field>> toCollection(collection: C): C

Make sequence to the collection.

Link copied to clipboard

Make sequence to the hashset.

Link copied to clipboard
fun toList(): List<Field>

Make sequence to the list.

Link copied to clipboard

Make sequence to the mutable list.

Link copied to clipboard

Make sequence to the mutable set.

Link copied to clipboard
fun toSet(): Set<Field>

Make sequence to the set.