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 convertStringto 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 booleanaccept(java.lang.Class<java.lang.String> type, java.lang.Class<?> multiValueType)Accept the source type and target type or notjava.lang.Objectconvert(java.lang.String[] segments, int size, java.lang.Class<?> targetType, java.lang.Class<?> elementType)Convert the segments to multiple value objectintgetPriority()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:MultiValueConverterAccept the source type and target type or not- Specified by:
acceptin 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:StringToMultiValueConverterConvert the segments to multiple value object- Specified by:
convertin 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:PrioritizedGet the priority- Specified by:
getPriorityin interfacePrioritized- Returns:
- the default is
minimum one
-
-