Package io.opencensus.common
Interface Function<A,B>
- All Known Implementing Classes:
MutableViewData.CreateCumulative
,MutableViewData.CreateInterval
,RecordUtils.AggregationDefaultFunction
,RecordUtils.CreateMutableCount
,RecordUtils.CreateMutableDistribution
,RecordUtils.CreateMutableLastValueDouble
,RecordUtils.CreateMutableLastValueLong
,RecordUtils.CreateMutableSumDouble
,RecordUtils.CreateMutableSumLong
public interface Function<A,B>
Used to specify matching functions for use encoding tagged unions (i.e. sum types) in Java. See
AttributeValue.match(io.opencensus.common.Function<? super java.lang.String, T>, io.opencensus.common.Function<? super java.lang.Boolean, T>, io.opencensus.common.Function<? super java.lang.Long, T>, io.opencensus.common.Function<java.lang.Object, T>)
for an example of its use.
Note: This class is based on the java.util.Function class added in Java 1.8. We cannot use the Function from Java 1.8 because this library is Java 1.6 compatible.
- Since:
- 0.5
-
Method Summary
-
Method Details
-
apply
Applies the function to the given argument.- Parameters:
arg
- the argument to the function.- Returns:
- the result of the function.
- Since:
- 0.5
-