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

Commit 1117bcb

Browse files
committed
Direct (no Maybe) onversions of primitives
1 parent 5705d3d commit 1117bcb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

+23
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,36 @@ class Converters(selector: ConverterSelectionStrategy) extends ConverterBase {
6666
}
6767

6868
def convertToByte[S: Type](sourceValue: S): Maybe[Byte] = convert[Byte](sourceValue)
69+
70+
def convertToByteEx[S: Type](sourceValue: S): Byte = convertEx[Byte](sourceValue)
71+
6972
def convertToBoolean[S: Type](sourceValue: S): Maybe[Boolean] = convert[Boolean](sourceValue)
73+
74+
def convertToBooleanEx[S: Type](sourceValue: S): Boolean = convertEx[Boolean](sourceValue)
75+
7076
def convertToShort[S: Type](sourceValue: S): Maybe[Short] = convert[Short](sourceValue)
77+
78+
def convertToShortEx[S: Type](sourceValue: S): Short = convertEx[Short](sourceValue)
79+
7180
def convertToChar[S: Type](sourceValue: S): Maybe[Char] = convert[Char](sourceValue)
81+
82+
def convertToCharEx[S: Type](sourceValue: S): Char = convertEx[Char](sourceValue)
83+
7284
def convertToInt[S: Type](sourceValue: S): Maybe[Int] = convert[Int](sourceValue)
85+
86+
def convertToIntEx[S: Type](sourceValue: S): Int = convertEx[Int](sourceValue)
87+
7388
def convertToLong[S: Type](sourceValue: S): Maybe[Long] = convert[Long](sourceValue)
89+
90+
def convertToLongEx[S: Type](sourceValue: S): Long = convertEx[Long](sourceValue)
91+
7492
def convertToFloat[S: Type](sourceValue: S): Maybe[Float] = convert[Float](sourceValue)
93+
94+
def convertToFloatEx[S: Type](sourceValue: S): Float = convertEx[Float](sourceValue)
95+
7596
def convertToDouble[S: Type](sourceValue: S): Maybe[Double] = convert[Double](sourceValue)
97+
98+
def convertToDoubleEx[S: Type](sourceValue: S): Double = convertEx[Double](sourceValue)
7699
}
77100

78101
object Converters {

0 commit comments

Comments
 (0)