Top Description Constructors Methods
com.dlsc.gemsfx.util

public Class ListUtils

extends Object
Class Inheritance
Imports
java.util.List, .ListIterator, .Objects, java.util.function.Predicate

Utility methods for working with lists.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <
the type of elements in the list
T
>
boolean
replaceIf(List<T>
the list to operate on
list
,
Predicate<T>
the predicate to match elements
matchPredicate
,
T
the new value to replace matching elements
newValue
)

Replaces matching elements in the list with the provided new value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ListUtilsback to summary
public ListUtils()

Method Detail

replaceIfback to summary
public static <T> boolean replaceIf(List<T> list, Predicate<T> matchPredicate, T newValue)

Replaces matching elements in the list with the provided new value.

Parameters
<T>
the type of elements in the list
list:List<T>

the list to operate on

matchPredicate:Predicate<T>

the predicate to match elements

newValue:T

the new value to replace matching elements