Package io.microsphere.convert.multiple
Class StringToIterableConverter<T extends java.lang.Iterable>
- java.lang.Object
-
- io.microsphere.convert.multiple.StringToIterableConverter<T>
-
- All Implemented Interfaces:
MultiValueConverter<java.lang.String>,StringToMultiValueConverter,Prioritized,java.lang.Comparable<Prioritized>
- Direct Known Subclasses:
StringToBlockingDequeConverter,StringToBlockingQueueConverter,StringToCollectionConverter,StringToDequeConverter,StringToListConverter,StringToNavigableSetConverter,StringToQueueConverter,StringToSetConverter,StringToSortedSetConverter,StringToTransferQueueConverter
public abstract class StringToIterableConverter<T extends java.lang.Iterable> extends java.lang.Object implements StringToMultiValueConverter
The class to convertStringtoIterable-based value- 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 StringToIterableConverter()
-
Method Summary
All Methods Instance Methods Abstract 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<?> multiValueType, java.lang.Class<?> elementType)Convert the segments to multiple value objectprotected abstract TcreateMultiValue(int size, java.lang.Class<?> multiValueType)intgetPriority()Get the priorityprotected java.util.Optional<StringConverter>getStringConverter(java.lang.Class<?> elementType)protected java.lang.Class<T>getSupportedType()-
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<T extends java.lang.Iterable>- Parameters:
type- the source typemultiValueType- the multi-value type- Returns:
- if accepted, return
true, orfalse
-
convert
public final java.lang.Object convert(java.lang.String[] segments, int size, java.lang.Class<?> multiValueType, 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 objectmultiValueType- the target typeelementType- the element type- Returns:
- multiple value object
-
createMultiValue
protected abstract T createMultiValue(int size, java.lang.Class<?> multiValueType)
-
getStringConverter
protected java.util.Optional<StringConverter> getStringConverter(java.lang.Class<?> elementType)
-
getSupportedType
protected final java.lang.Class<T> getSupportedType()
-
getPriority
public final int getPriority()
Description copied from interface:PrioritizedGet the priority- Specified by:
getPriorityin interfacePrioritized- Returns:
- the default is
minimum one
-
-