Package org.apache.dubbo.common.convert
Interface Converter<S,T>
- Type Parameters:
S- The source typeT- The target type
- All Superinterfaces:
Comparable<Prioritized>,Prioritized
- All Known Subinterfaces:
StringConverter<T>
- All Known Implementing Classes:
StringToBooleanConverter,StringToByteConverter,StringToCharacterConverter,StringToCharArrayConverter,StringToDoubleConverter,StringToDurationConverter,StringToFloatConverter,StringToIntegerConverter,StringToLongConverter,StringToOptionalConverter,StringToShortConverter,StringToStringConverter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A class to convert the source-typed value to the target-typed value
- Since:
- 2.7.6
-
Field Summary
Fields inherited from interface org.apache.dubbo.common.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanAccept the source type and target type or notConvert the source-typed value to the target-typed valueGet the source typeGet the target typeMethods inherited from interface org.apache.dubbo.common.lang.Prioritized
compareTo, getPriority
-
Method Details
-
accept
Accept the source type and target type or not- Parameters:
sourceType- the source typetargetType- the target type- Returns:
- if accepted, return
true, orfalse
-
convert
Convert the source-typed value to the target-typed value- Parameters:
source- the source-typed value- Returns:
- the target-typed value
-
getSourceType
Get the source type- Returns:
- non-null
-
getTargetType
Get the target type- Returns:
- non-null
-