Package io.opencensus.common
Class Functions
java.lang.Object
io.opencensus.common.Functions
Commonly used
Function
instances.- Since:
- 0.5
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreturnConstant
(T constant) AFunction
that always ignores its argument and returns a constant value.AFunction
that always ignores its argument and returnsnull
.AFunction
that always returns theObject.toString()
value of the input.AFunction
that always ignores its argument and throws anAssertionError
.AFunction
that always ignores its argument and throws anIllegalArgumentException
.
-
Field Details
-
RETURN_NULL
-
THROW_ILLEGAL_ARGUMENT_EXCEPTION
-
THROW_ASSERTION_ERROR
-
RETURN_TO_STRING
-
-
Constructor Details
-
Functions
private Functions()
-
-
Method Details
-
returnNull
AFunction
that always ignores its argument and returnsnull
.- Returns:
- a
Function
that always ignores its argument and returnsnull
. - Since:
- 0.5
-
returnConstant
AFunction
that always ignores its argument and returns a constant value.- Returns:
- a
Function
that always ignores its argument and returns a constant value. - Since:
- 0.5
-
returnToString
AFunction
that always returns theObject.toString()
value of the input.- Returns:
- a
Function
that always returns theObject.toString()
value of the input. - Since:
- 0.17
-
throwIllegalArgumentException
AFunction
that always ignores its argument and throws anIllegalArgumentException
.- Returns:
- a
Function
that always ignores its argument and throws anIllegalArgumentException
. - Since:
- 0.5
-
throwAssertionError
AFunction
that always ignores its argument and throws anAssertionError
.- Returns:
- a
Function
that always ignores its argument and throws anAssertionError
. - Since:
- 0.6
-