Package io.microsphere.convert.multiple
Class StringToArrayConverter
- java.lang.Object
-
- io.microsphere.convert.multiple.StringToArrayConverter
-
- All Implemented Interfaces:
MultiValueConverter<java.lang.String>
,StringToMultiValueConverter
,Prioritized
,java.lang.Comparable<Prioritized>
public class StringToArrayConverter extends java.lang.Object implements StringToMultiValueConverter
The class to convertString
to array-type object- Since:
- 1.0.0
-
-
Field Summary
-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description StringToArrayConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(java.lang.Class<java.lang.String> type, java.lang.Class<?> multiValueType)
Accept the source type and target type or notjava.lang.Object
convert(java.lang.String[] segments, int size, java.lang.Class<?> targetType, java.lang.Class<?> elementType)
Convert the segments to multiple value objectint
getPriority()
Get the priority-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.microsphere.convert.multiple.MultiValueConverter
getSourceType
-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo
-
Methods inherited from interface io.microsphere.convert.multiple.StringToMultiValueConverter
convert
-
-
-
-
Method Detail
-
accept
public boolean accept(java.lang.Class<java.lang.String> type, java.lang.Class<?> multiValueType)
Description copied from interface:MultiValueConverter
Accept the source type and target type or not- Specified by:
accept
in interfaceMultiValueConverter<java.lang.String>
- Parameters:
type
- the source typemultiValueType
- the multi-value type- Returns:
- if accepted, return
true
, orfalse
-
convert
public java.lang.Object convert(java.lang.String[] segments, int size, java.lang.Class<?> targetType, java.lang.Class<?> elementType)
Description copied from interface:StringToMultiValueConverter
Convert the segments to multiple value object- Specified by:
convert
in interfaceStringToMultiValueConverter
- Parameters:
segments
- the String array of contentsize
- the size of multiple value objecttargetType
- the target typeelementType
- the element type- Returns:
- multiple value object
-
getPriority
public int getPriority()
Description copied from interface:Prioritized
Get the priority- Specified by:
getPriority
in interfacePrioritized
- Returns:
- the default is
minimum one
-
-