Package org.osgi.util.converter
Class TypeRule<F,T>
java.lang.Object
org.osgi.util.converter.TypeRule<F,T>
- Type Parameters:
F- The type to convert from.T- The type to convert to.
- All Implemented Interfaces:
TargetRule
Rule implementation that works by passing in type arguments rather than
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.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe function to perform the conversion.The target type of this rule.
-
Constructor Details
-
TypeRule
Create an instance based on source, target types and a conversion function.- Parameters:
from- The type to convert from.to- The type to convert to.func- The conversion function to use.
-
-
Method Details
-
getFunction
Description copied from interface:TargetRuleThe function to perform the conversion.- Specified by:
getFunctionin interfaceTargetRule- Returns:
- The function.
-
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.
-