Skip to content
This repository was archived by the owner on Aug 17, 2019. It is now read-only.

Commit 704e4dc

Browse files
committed
Use MaybeEither instead of Maybe
1 parent fcc1540 commit 704e4dc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/scala/com/ckkloverdos/convert/ConverterBase.scala

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package com.ckkloverdos.convert
1818

19-
import com.ckkloverdos.maybe.Maybe
2019
import org.slf4j.LoggerFactory
20+
import com.ckkloverdos.maybe.MaybeEither
2121

2222
/**
2323
*
@@ -43,7 +43,7 @@ trait ConverterBase {
4343
@throws(classOf[ConverterException])
4444
def convertEx[T: Type](sourceValue: Any): T
4545

46-
def convert[T: Type](sourceValue: Any): Maybe[T] = Maybe {
46+
def convert[T: Type](sourceValue: Any): MaybeEither[T] = MaybeEither {
4747
// logger.debug("ConverterBase::convert(%s: %s): %s".format(sourceValue, sourceValue.getClass, manifest[T]))
4848
convertEx[T](sourceValue)
4949
}
@@ -59,49 +59,49 @@ trait ConverterBase {
5959
}
6060
}
6161

62-
def convertToByte[S: Type](sourceValue: S): Maybe[Byte] = convert[Byte](sourceValue)
62+
def convertToByte[S: Type](sourceValue: S): MaybeEither[Byte] = convert[Byte](sourceValue)
6363

6464
def convertToByteOpt[S: Type](sourceValue: S): Option[Byte] = convertOpt[Byte](sourceValue)
6565

6666
def convertToByteEx[S: Type](sourceValue: S): Byte = convertEx[Byte](sourceValue)
6767

68-
def convertToBoolean[S: Type](sourceValue: S): Maybe[Boolean] = convert[Boolean](sourceValue)
68+
def convertToBoolean[S: Type](sourceValue: S): MaybeEither[Boolean] = convert[Boolean](sourceValue)
6969

7070
def convertToBooleanOpt[S: Type](sourceValue: S): Option[Boolean] = convertOpt[Boolean](sourceValue)
7171

7272
def convertToBooleanEx[S: Type](sourceValue: S): Boolean = convertEx[Boolean](sourceValue)
7373

74-
def convertToShort[S: Type](sourceValue: S): Maybe[Short] = convert[Short](sourceValue)
74+
def convertToShort[S: Type](sourceValue: S): MaybeEither[Short] = convert[Short](sourceValue)
7575

7676
def convertToShortOpt[S: Type](sourceValue: S): Option[Short] = convertOpt[Short](sourceValue)
7777

7878
def convertToShortEx[S: Type](sourceValue: S): Short = convertEx[Short](sourceValue)
7979

80-
def convertToChar[S: Type](sourceValue: S): Maybe[Char] = convert[Char](sourceValue)
80+
def convertToChar[S: Type](sourceValue: S): MaybeEither[Char] = convert[Char](sourceValue)
8181

8282
def convertToCharOpt[S: Type](sourceValue: S): Option[Char] = convertOpt[Char](sourceValue)
8383

8484
def convertToCharEx[S: Type](sourceValue: S): Char = convertEx[Char](sourceValue)
8585

86-
def convertToInt[S: Type](sourceValue: S): Maybe[Int] = convert[Int](sourceValue)
86+
def convertToInt[S: Type](sourceValue: S): MaybeEither[Int] = convert[Int](sourceValue)
8787

8888
def convertToIntOpt[S: Type](sourceValue: S): Option[Int] = convertOpt[Int](sourceValue)
8989

9090
def convertToIntEx[S: Type](sourceValue: S): Int = convertEx[Int](sourceValue)
9191

92-
def convertToLong[S: Type](sourceValue: S): Maybe[Long] = convert[Long](sourceValue)
92+
def convertToLong[S: Type](sourceValue: S): MaybeEither[Long] = convert[Long](sourceValue)
9393

9494
def convertToLongOpt[S: Type](sourceValue: S): Option[Long] = convertOpt[Long](sourceValue)
9595

9696
def convertToLongEx[S: Type](sourceValue: S): Long = convertEx[Long](sourceValue)
9797

98-
def convertToFloat[S: Type](sourceValue: S): Maybe[Float] = convert[Float](sourceValue)
98+
def convertToFloat[S: Type](sourceValue: S): MaybeEither[Float] = convert[Float](sourceValue)
9999

100100
def convertToFloatOpt[S: Type](sourceValue: S): Option[Float] = convertOpt[Float](sourceValue)
101101

102102
def convertToFloatEx[S: Type](sourceValue: S): Float = convertEx[Float](sourceValue)
103103

104-
def convertToDouble[S: Type](sourceValue: S): Maybe[Double] = convert[Double](sourceValue)
104+
def convertToDouble[S: Type](sourceValue: S): MaybeEither[Double] = convert[Double](sourceValue)
105105

106106
def convertToDoubleOpt[S: Type](sourceValue: S): Option[Double] = convertOpt[Double](sourceValue)
107107

0 commit comments

Comments
 (0)