T
- the value's typepublic class Value<T> extends java.lang.Object implements Supplier<T>
This class can be useful when using the Java application API in the absence of Java8 lambda expressions. e.g.,
// with Java8 Lambda expressions
TStream<String> s = ...
s.parallel(() -> 3).filter(...)
// without Lambda expressions
s.parallel(new Value<Integer>(3)).filter(...)
// using the Value.of with a static import
s.parallel(of(3)).filter();
Constructor and Description |
---|
Value(T value)
Create a constant value
Supplier . |
Modifier and Type | Method and Description |
---|---|
T |
get()
Return the constant value.
|
static <T> Supplier<T> |
of(T value)
Return a constant value
Supplier . |
public Value(T value)
Supplier
.value
- the value