Package org.osgi.util.converter
Class Rule<F,T>
- java.lang.Object
-
- org.osgi.util.converter.Rule<F,T>
-
- Type Parameters:
F- The type to convert from.T- The type to convert to.
- All Implemented Interfaces:
TargetRule
public abstract class Rule<F,T> extends java.lang.Object implements TargetRule
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 theRuleimplementation. Filtering on the to is done by the converter customization mechanism.
-
-
Field Summary
Fields Modifier and Type Field Description private ConverterFunctionfunction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConverterFunctiongetFunction()The function to perform the conversion.private ConverterFunctiongetGenericFunction(Function<F,T> func)java.lang.reflect.TypegetTargetType()The target type of this rule.
-
-
-
Field Detail
-
function
private final ConverterFunction function
-
-
Method Detail
-
getGenericFunction
private ConverterFunction getGenericFunction(Function<F,T> func)
-
getFunction
public ConverterFunction getFunction()
Description copied from interface:TargetRuleThe function to perform the conversion.- Specified by:
getFunctionin interfaceTargetRule- Returns:
- The function.
-
getTargetType
public java.lang.reflect.Type getTargetType()
Description copied from interface:TargetRuleThe target type of this rule. The conversion function is invoked for each conversion to the target type.- Specified by:
getTargetTypein interfaceTargetRule- Returns:
- The target type.
-
-