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

Commit b12a123

Browse files
committed
Move a few methods up in the hierarchy
1 parent 82730ca commit b12a123

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

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

+32
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,36 @@ trait ConverterBase {
5858
None
5959
}
6060
}
61+
62+
def convertToByte[S: Type](sourceValue: S): Maybe[Byte] = convert[Byte](sourceValue)
63+
64+
def convertToByteEx[S: Type](sourceValue: S): Byte = convertEx[Byte](sourceValue)
65+
66+
def convertToBoolean[S: Type](sourceValue: S): Maybe[Boolean] = convert[Boolean](sourceValue)
67+
68+
def convertToBooleanEx[S: Type](sourceValue: S): Boolean = convertEx[Boolean](sourceValue)
69+
70+
def convertToShort[S: Type](sourceValue: S): Maybe[Short] = convert[Short](sourceValue)
71+
72+
def convertToShortEx[S: Type](sourceValue: S): Short = convertEx[Short](sourceValue)
73+
74+
def convertToChar[S: Type](sourceValue: S): Maybe[Char] = convert[Char](sourceValue)
75+
76+
def convertToCharEx[S: Type](sourceValue: S): Char = convertEx[Char](sourceValue)
77+
78+
def convertToInt[S: Type](sourceValue: S): Maybe[Int] = convert[Int](sourceValue)
79+
80+
def convertToIntEx[S: Type](sourceValue: S): Int = convertEx[Int](sourceValue)
81+
82+
def convertToLong[S: Type](sourceValue: S): Maybe[Long] = convert[Long](sourceValue)
83+
84+
def convertToLongEx[S: Type](sourceValue: S): Long = convertEx[Long](sourceValue)
85+
86+
def convertToFloat[S: Type](sourceValue: S): Maybe[Float] = convert[Float](sourceValue)
87+
88+
def convertToFloatEx[S: Type](sourceValue: S): Float = convertEx[Float](sourceValue)
89+
90+
def convertToDouble[S: Type](sourceValue: S): Maybe[Double] = convert[Double](sourceValue)
91+
92+
def convertToDoubleEx[S: Type](sourceValue: S): Double = convertEx[Double](sourceValue)
6193
}

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

-32
Original file line numberDiff line numberDiff line change
@@ -64,38 +64,6 @@ class Converters(selector: ConverterSelectionStrategy) extends ConverterBase {
6464
throw new ConverterException(errMsg, exception)
6565
}
6666
}
67-
68-
def convertToByte[S: Type](sourceValue: S): Maybe[Byte] = convert[Byte](sourceValue)
69-
70-
def convertToByteEx[S: Type](sourceValue: S): Byte = convertEx[Byte](sourceValue)
71-
72-
def convertToBoolean[S: Type](sourceValue: S): Maybe[Boolean] = convert[Boolean](sourceValue)
73-
74-
def convertToBooleanEx[S: Type](sourceValue: S): Boolean = convertEx[Boolean](sourceValue)
75-
76-
def convertToShort[S: Type](sourceValue: S): Maybe[Short] = convert[Short](sourceValue)
77-
78-
def convertToShortEx[S: Type](sourceValue: S): Short = convertEx[Short](sourceValue)
79-
80-
def convertToChar[S: Type](sourceValue: S): Maybe[Char] = convert[Char](sourceValue)
81-
82-
def convertToCharEx[S: Type](sourceValue: S): Char = convertEx[Char](sourceValue)
83-
84-
def convertToInt[S: Type](sourceValue: S): Maybe[Int] = convert[Int](sourceValue)
85-
86-
def convertToIntEx[S: Type](sourceValue: S): Int = convertEx[Int](sourceValue)
87-
88-
def convertToLong[S: Type](sourceValue: S): Maybe[Long] = convert[Long](sourceValue)
89-
90-
def convertToLongEx[S: Type](sourceValue: S): Long = convertEx[Long](sourceValue)
91-
92-
def convertToFloat[S: Type](sourceValue: S): Maybe[Float] = convert[Float](sourceValue)
93-
94-
def convertToFloatEx[S: Type](sourceValue: S): Float = convertEx[Float](sourceValue)
95-
96-
def convertToDouble[S: Type](sourceValue: S): Maybe[Double] = convert[Double](sourceValue)
97-
98-
def convertToDoubleEx[S: Type](sourceValue: S): Double = convertEx[Double](sourceValue)
9967
}
10068

10169
object Converters {

0 commit comments

Comments
 (0)