16
16
17
17
package com .ckkloverdos .convert
18
18
19
- import com .ckkloverdos .maybe .Maybe
20
19
import org .slf4j .LoggerFactory
20
+ import com .ckkloverdos .maybe .MaybeEither
21
21
22
22
/**
23
23
*
@@ -43,7 +43,7 @@ trait ConverterBase {
43
43
@ throws(classOf [ConverterException ])
44
44
def convertEx [T : Type ](sourceValue : Any ): T
45
45
46
- def convert [T : Type ](sourceValue : Any ): Maybe [T ] = Maybe {
46
+ def convert [T : Type ](sourceValue : Any ): MaybeEither [T ] = MaybeEither {
47
47
// logger.debug("ConverterBase::convert(%s: %s): %s".format(sourceValue, sourceValue.getClass, manifest[T]))
48
48
convertEx[T ](sourceValue)
49
49
}
@@ -59,49 +59,49 @@ trait ConverterBase {
59
59
}
60
60
}
61
61
62
- def convertToByte [S : Type ](sourceValue : S ): Maybe [Byte ] = convert[Byte ](sourceValue)
62
+ def convertToByte [S : Type ](sourceValue : S ): MaybeEither [Byte ] = convert[Byte ](sourceValue)
63
63
64
64
def convertToByteOpt [S : Type ](sourceValue : S ): Option [Byte ] = convertOpt[Byte ](sourceValue)
65
65
66
66
def convertToByteEx [S : Type ](sourceValue : S ): Byte = convertEx[Byte ](sourceValue)
67
67
68
- def convertToBoolean [S : Type ](sourceValue : S ): Maybe [Boolean ] = convert[Boolean ](sourceValue)
68
+ def convertToBoolean [S : Type ](sourceValue : S ): MaybeEither [Boolean ] = convert[Boolean ](sourceValue)
69
69
70
70
def convertToBooleanOpt [S : Type ](sourceValue : S ): Option [Boolean ] = convertOpt[Boolean ](sourceValue)
71
71
72
72
def convertToBooleanEx [S : Type ](sourceValue : S ): Boolean = convertEx[Boolean ](sourceValue)
73
73
74
- def convertToShort [S : Type ](sourceValue : S ): Maybe [Short ] = convert[Short ](sourceValue)
74
+ def convertToShort [S : Type ](sourceValue : S ): MaybeEither [Short ] = convert[Short ](sourceValue)
75
75
76
76
def convertToShortOpt [S : Type ](sourceValue : S ): Option [Short ] = convertOpt[Short ](sourceValue)
77
77
78
78
def convertToShortEx [S : Type ](sourceValue : S ): Short = convertEx[Short ](sourceValue)
79
79
80
- def convertToChar [S : Type ](sourceValue : S ): Maybe [Char ] = convert[Char ](sourceValue)
80
+ def convertToChar [S : Type ](sourceValue : S ): MaybeEither [Char ] = convert[Char ](sourceValue)
81
81
82
82
def convertToCharOpt [S : Type ](sourceValue : S ): Option [Char ] = convertOpt[Char ](sourceValue)
83
83
84
84
def convertToCharEx [S : Type ](sourceValue : S ): Char = convertEx[Char ](sourceValue)
85
85
86
- def convertToInt [S : Type ](sourceValue : S ): Maybe [Int ] = convert[Int ](sourceValue)
86
+ def convertToInt [S : Type ](sourceValue : S ): MaybeEither [Int ] = convert[Int ](sourceValue)
87
87
88
88
def convertToIntOpt [S : Type ](sourceValue : S ): Option [Int ] = convertOpt[Int ](sourceValue)
89
89
90
90
def convertToIntEx [S : Type ](sourceValue : S ): Int = convertEx[Int ](sourceValue)
91
91
92
- def convertToLong [S : Type ](sourceValue : S ): Maybe [Long ] = convert[Long ](sourceValue)
92
+ def convertToLong [S : Type ](sourceValue : S ): MaybeEither [Long ] = convert[Long ](sourceValue)
93
93
94
94
def convertToLongOpt [S : Type ](sourceValue : S ): Option [Long ] = convertOpt[Long ](sourceValue)
95
95
96
96
def convertToLongEx [S : Type ](sourceValue : S ): Long = convertEx[Long ](sourceValue)
97
97
98
- def convertToFloat [S : Type ](sourceValue : S ): Maybe [Float ] = convert[Float ](sourceValue)
98
+ def convertToFloat [S : Type ](sourceValue : S ): MaybeEither [Float ] = convert[Float ](sourceValue)
99
99
100
100
def convertToFloatOpt [S : Type ](sourceValue : S ): Option [Float ] = convertOpt[Float ](sourceValue)
101
101
102
102
def convertToFloatEx [S : Type ](sourceValue : S ): Float = convertEx[Float ](sourceValue)
103
103
104
- def convertToDouble [S : Type ](sourceValue : S ): Maybe [Double ] = convert[Double ](sourceValue)
104
+ def convertToDouble [S : Type ](sourceValue : S ): MaybeEither [Double ] = convert[Double ](sourceValue)
105
105
106
106
def convertToDoubleOpt [S : Type ](sourceValue : S ): Option [Double ] = convertOpt[Double ](sourceValue)
107
107
0 commit comments