Package io.microsphere.convert
Class ObjectToOptionalConverter
- java.lang.Object
-
- io.microsphere.convert.ObjectToOptionalConverter
-
- All Implemented Interfaces:
Converter<java.lang.Object,java.util.Optional>
,Prioritized
,java.lang.Comparable<Prioritized>
public class ObjectToOptionalConverter extends java.lang.Object implements Converter<java.lang.Object,java.util.Optional>
The class to convertObject
toOptional
- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static ObjectToOptionalConverter
INSTANCE
Singleton instance ofObjectToOptionalConverter
.-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description ObjectToOptionalConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional
convert(java.lang.Object source)
Convert the source-typed value to the target-typed valueint
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.Converter
accept, getSourceType, getTargetType
-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo
-
-
-
-
Field Detail
-
INSTANCE
public static final ObjectToOptionalConverter INSTANCE
Singleton instance ofObjectToOptionalConverter
.
-
-
Method Detail
-
convert
public java.util.Optional convert(java.lang.Object source)
Description copied from interface:Converter
Convert the source-typed value to the target-typed value
-
getPriority
public int getPriority()
Description copied from interface:Prioritized
Get the priority- Specified by:
getPriority
in interfacePrioritized
- Returns:
- the default is
minimum one
-
-