java.lang.Object
me.sbasalaev.API
Useful utilities meant to be imported statically.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T> Returns list with given element appended to the end of given list.static <T> Traversable<T> chain(Traversable<? extends T>... elements) Chains several traversables together.static <T> List<T> Concatenates several lists together.static <T,R> Function <T, R> constant(R result) Constant function.static <T> List<T> list()Empty list.static <T> List<T> list(T... elements) List of given elements.static <T> Opt<T> Wraps value into optional.static <T> Opt<T> none()Empty optional.static <T> Set<T> set()Empty set.static <T> Set<T> set(T... elements) Set of given elements.static <T> Opt<T> some(T value) Non-empty optional.static intsum(Traversable<Integer> numbers) Returns sum of all numbers in a given traversable.static <T> TTODO()Throws NotImplementedError when evaluated.static <T> TThrows NotImplementedError when evaluated.
-
Method Details
-
TODO
public static <T> T TODO()Throws NotImplementedError when evaluated. -
TODO
Throws NotImplementedError when evaluated. -
constant
Constant function. -
none
Empty optional. -
some
Non-empty optional. -
maybe
Wraps value into optional. -
list
Empty list. -
list
List of given elements. -
set
Empty set. -
set
Set of given elements. -
chain
Chains several traversables together.- See Also:
-
concat
Concatenates several lists together. The returned list is immutable and is not affected by changes to the original lists. -
append
Returns list with given element appended to the end of given list. The returned list is immutable and is not affected by changes to the original list.- Since:
- 3.1
-
sum
Returns sum of all numbers in a given traversable.
-