Top Description Fields Constructors Methods
org.osgi.util.converter

public abstract Class Rule<F, T>

extends Object
implements TargetRule
Class Inheritance
All Implemented Interfaces
org.osgi.util.converter.TargetRule
Type Parameters
<F>
The type to convert from.
<T>
The type to convert to.
Imports
java.lang.reflect.ParameterizedType, .Type, org.osgi.util.function.Function

A rule implementation that works by capturing the type arguments via subclassing. The rule supports specifying both from and to types. Filtering on the from by the Rule implementation. Filtering on the to is done by the converter customization mechanism.
Author
$Id: 5f1dce9259e3bfad58df897f326493a56ae47abc $

Field Summary

Modifier and TypeField and Description
private final ConverterFunction

Constructor Summary

AccessConstructor and Description
public
Rule(Function<F, T>
The conversion function to use.
func
)

Create an instance with a conversion function.

Method Summary

Modifier and TypeMethod and Description
public ConverterFunction
getFunction()

Implements org.osgi.util.converter.TargetRule.getFunction.

The function to perform the conversion.

private ConverterFunction
getGenericFunction(final Function<F, T> func)

public Type
getTargetType()

Implements org.osgi.util.converter.TargetRule.getTargetType.

The target type of this rule.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

functionback to summary
private final ConverterFunction function

Constructor Detail

Ruleback to summary
public Rule(Function<F, T> func)

Create an instance with a conversion function.

Parameters
func:Function<F, T>

The conversion function to use.

Method Detail

getFunctionback to summary
public ConverterFunction getFunction()

Implements org.osgi.util.converter.TargetRule.getFunction.

Doc from org.osgi.util.converter.TargetRule.getFunction.

The function to perform the conversion.

Returns:ConverterFunction

The function.

Annotations
@Override
getGenericFunctionback to summary
private ConverterFunction getGenericFunction(final Function<F, T> func)
getTargetTypeback to summary
public Type getTargetType()

Implements org.osgi.util.converter.TargetRule.getTargetType.

Doc from org.osgi.util.converter.TargetRule.getTargetType.

The target type of this rule. The conversion function is invoked for each conversion to the target type.

Returns:Type

The target type.

Annotations
@Override