Skip to content

Commit

Permalink
refactor: Make private
Browse files Browse the repository at this point in the history
  • Loading branch information
sya-ri committed Jun 10, 2024
1 parent 831f1bf commit 94232e2
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/main/kotlin/dev/s7a/ktconfig/internal/Deserializer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ internal class Deserializer {
}
}

fun int(value: Number): Int {
private fun int(value: Number): Int {
return value.toInt()
}

fun int(value: String): Int? {
private fun int(value: String): Int? {
return number(value)?.let(::int)
}

Expand All @@ -59,7 +59,7 @@ internal class Deserializer {
return int(value).toUInt()
}

fun uint(value: String): UInt? {
private fun uint(value: String): UInt? {
return number(value)?.let(::uint)
}

Expand All @@ -71,7 +71,7 @@ internal class Deserializer {
}
}

fun boolean(value: String): Boolean? {
private fun boolean(value: String): Boolean? {
return runCatching {
constructYamlBool.construct(node(value)) as Boolean
}.getOrNull()
Expand All @@ -89,7 +89,7 @@ internal class Deserializer {
return value.toDouble()
}

fun double(value: String): Double? {
private fun double(value: String): Double? {
return runCatching {
constructYamlFloat.construct(node(value)) as Double
}.getOrNull()
Expand All @@ -107,7 +107,7 @@ internal class Deserializer {
return double(value).toFloat()
}

fun float(value: String): Float? {
private fun float(value: String): Float? {
return double(value)?.toFloat()
}

Expand All @@ -123,7 +123,7 @@ internal class Deserializer {
return value.toLong()
}

fun long(value: String): Long? {
private fun long(value: String): Long? {
return number(value)?.let(::long)
}

Expand All @@ -139,7 +139,7 @@ internal class Deserializer {
return long(value).toULong()
}

fun ulong(value: String): ULong? {
private fun ulong(value: String): ULong? {
return number(value)?.let(::ulong)
}

Expand All @@ -155,7 +155,7 @@ internal class Deserializer {
return value.toByte()
}

fun byte(value: String): Byte? {
private fun byte(value: String): Byte? {
return number(value)?.let(::byte)
}

Expand All @@ -167,11 +167,11 @@ internal class Deserializer {
}
}

fun ubyte(value: Number): UByte {
private fun ubyte(value: Number): UByte {
return byte(value).toUByte()
}

fun ubyte(value: String): UByte? {
private fun ubyte(value: String): UByte? {
return number(value)?.let(::ubyte)
}

Expand All @@ -187,7 +187,7 @@ internal class Deserializer {
return value.toInt().toChar()
}

fun char(value: String): Char? {
private fun char(value: String): Char? {
return value.singleOrNull()
}

Expand All @@ -203,7 +203,7 @@ internal class Deserializer {
return value.toShort()
}

fun short(value: String): Short? {
private fun short(value: String): Short? {
return number(value)?.let(::short)
}

Expand All @@ -219,7 +219,7 @@ internal class Deserializer {
return short(value).toUShort()
}

fun ushort(value: String): UShort? {
private fun ushort(value: String): UShort? {
return number(value)?.let(::ushort)
}

Expand All @@ -231,11 +231,11 @@ internal class Deserializer {
}
}

fun bigInteger(value: Number): BigInteger {
private fun bigInteger(value: Number): BigInteger {
return BigInteger(value.toString())
}

fun bigInteger(value: String): BigInteger? {
private fun bigInteger(value: String): BigInteger? {
return number(value)?.run {
if (this is BigInteger) {
this
Expand All @@ -257,7 +257,7 @@ internal class Deserializer {
return BigDecimal(value.toString())
}

fun bigDecimal(value: String): BigDecimal? {
private fun bigDecimal(value: String): BigDecimal? {
return runCatching {
BigDecimal(value)
}.getOrNull()
Expand All @@ -271,7 +271,7 @@ internal class Deserializer {
}
}

fun date(value: String): Date? {
private fun date(value: String): Date? {
return runCatching {
constructYamlTimestamp.construct(node(value)) as Date
}.getOrNull()
Expand Down Expand Up @@ -302,7 +302,7 @@ internal class Deserializer {
}
}

fun uuid(value: String): UUID? {
private fun uuid(value: String): UUID? {
return runCatching { UUID.fromString(value) }.getOrNull()
}

Expand Down

0 comments on commit 94232e2

Please sign in to comment.