public class FpKit
extends java.lang.Object
Constructor and Description |
---|
FpKit() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.List<T> |
concat(java.util.List<T> l1,
java.util.List<T> l2)
Concatenates two lists into one
|
static <T> java.util.List<T> |
concat(java.util.List<T> l,
T t)
Concatenates (appends) a single elements to an existing list
|
static <T> java.util.Map<java.lang.String,T> |
getByName(java.util.List<T> namedObjects,
java.util.function.Function<T,java.lang.String> nameFn) |
static <T> java.util.Map<java.lang.String,T> |
getByName(java.util.List<T> namedObjects,
java.util.function.Function<T,java.lang.String> nameFn,
java.util.function.BinaryOperator<T> mergeFunc) |
static <T> java.util.function.BinaryOperator<T> |
mergeFirst() |
static <T> java.util.Collection<T> |
toCollection(java.lang.Object iterableResult)
Converts an object that should be an Iterable into a Collection efficiently, leaving
it alone if it is already is one.
|
static <T> java.util.List<T> |
valuesToList(java.util.Map<?,T> map) |
public static <T> java.util.Map<java.lang.String,T> getByName(java.util.List<T> namedObjects, java.util.function.Function<T,java.lang.String> nameFn, java.util.function.BinaryOperator<T> mergeFunc)
public static <T> java.util.Map<java.lang.String,T> getByName(java.util.List<T> namedObjects, java.util.function.Function<T,java.lang.String> nameFn)
public static <T> java.util.function.BinaryOperator<T> mergeFirst()
public static <T> java.util.Collection<T> toCollection(java.lang.Object iterableResult)
T
- the type of thingiterableResult
- the result objectjava.lang.ClassCastException
- if its not an Iterablepublic static <T> java.util.List<T> concat(java.util.List<T> l, T t)
T
- the type of elements of the listl
- the list onto which to append the elementt
- the element to appendpublic static <T> java.util.List<T> concat(java.util.List<T> l1, java.util.List<T> l2)
T
- the type of element of the listsl1
- the first list to concatenatel2
- the second list to concatenatepublic static <T> java.util.List<T> valuesToList(java.util.Map<?,T> map)