Package io.microsphere.convert
Class StringToLongConverter
- java.lang.Object
-
- io.microsphere.convert.AbstractConverter<java.lang.String,java.lang.Long>
-
- io.microsphere.convert.StringToLongConverter
-
- All Implemented Interfaces:
Converter<java.lang.String,java.lang.Long>,StringConverter<java.lang.Long>,Prioritized,java.lang.Comparable<Prioritized>
public class StringToLongConverter extends AbstractConverter<java.lang.String,java.lang.Long> implements StringConverter<java.lang.Long>
The class to convertStringtoLong- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringToLongConverterINSTANCESingleton instance ofStringToLongConverter.-
Fields inherited from class io.microsphere.convert.AbstractConverter
logger
-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description StringToLongConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.LongdoConvert(java.lang.String source)Converts the non-null source-typed value to the target-typed value.-
Methods inherited from class io.microsphere.convert.AbstractConverter
convert, equals, getPriority, hashCode, resolvePriority
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.microsphere.convert.Converter
accept, convert, getSourceType, getTargetType
-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo, getPriority
-
-
-
-
Field Detail
-
INSTANCE
public static final StringToLongConverter INSTANCE
Singleton instance ofStringToLongConverter.
-
-
Method Detail
-
doConvert
protected java.lang.Long doConvert(java.lang.String source)
Description copied from class:AbstractConverterConverts the non-null source-typed value to the target-typed value.This method is called by
AbstractConverter.convert(Object)after checking if the source is null. Subclasses must implement this method to provide the actual conversion logic.- Specified by:
doConvertin classAbstractConverter<java.lang.String,java.lang.Long>- Parameters:
source- the non-null source-typed value- Returns:
- the converted target-typed value, or
nullif conversion is not possible
-
-