Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
private E |
value |
Constructor and Description |
---|
ConstantFunction(E value) |
Modifier and Type | Method and Description |
---|---|
E |
apply(java.lang.Object from)
Returns the result of applying this function to
input . |
boolean |
equals(java.lang.Object obj)
May return
true if is a Function that behaves identically to
this function. |
int |
hashCode() |
java.lang.String |
toString() |
private final E value
private static final long serialVersionUID
public ConstantFunction(@Nullable E value)
public E apply(@Nullable java.lang.Object from)
Function
input
. This method is generally
expected, but not absolutely required, to have the following properties:
Objects.equal
(a, b)
implies that Objects.equal(function.apply(a),
function.apply(b))
.
public boolean equals(@Nullable java.lang.Object obj)
Function
true
if is a Function
that behaves identically to
this function.
Warning: do not depend on the behavior of this method.
Historically, Function
instances in this library have implemented this method to
recognize certain cases where distinct Function
instances would in fact behave
identically. However, as code migrates to java.util.function
, that behavior will
disappear. It is best not to depend on it.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object