Skip to content

Commit 916d9ca

Browse files
committed
Add (2) jvmoverloads for test
1 parent 4db465c commit 916d9ca

File tree

1 file changed

+7
-0
lines changed
  • omegatypes/src/main/java/com/omega_r/libs/omegatypes

1 file changed

+7
-0
lines changed

omegatypes/src/main/java/com/omega_r/libs/omegatypes/Text.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,31 @@ open class Text(protected val defaultTextStyle: TextStyle? ) : Serializable {
2121
fun empty(): Text = Text(null)
2222

2323
@JvmStatic
24+
@JvmOverloads
2425
fun from(string: String, textStyle: TextStyle? = null): Text = StringText(string, textStyle)
2526

2627
@JvmStatic
28+
@JvmOverloads
2729
fun from(stringRes: Int, textStyle: TextStyle? = null): Text = ResourceText(stringRes, textStyle)
2830

2931
@JvmStatic
32+
@JvmOverloads
3033
fun from(stringRes: Int, vararg formatArgs: Any, textStyle: TextStyle? = null): Text = FormatResourceText(stringRes, *formatArgs, textStyle = textStyle)
3134

3235
@JvmStatic
36+
@JvmOverloads
3337
fun from(stringHolder: StringHolder, textStyle: TextStyle? = null): Text = stringHolder.getStringText()?.let { from(it, textStyle) } ?: empty()
3438

3539
@JvmStatic
40+
@JvmOverloads
3641
fun from(throwable: Throwable, textStyle: TextStyle? = null): Text = StringText(throwable.message, textStyle)
3742

3843
@JvmStatic
44+
@JvmOverloads
3945
fun from(vararg texts: Text, textStyle: TextStyle? = null): Text = ArrayText(*texts, textStyle = textStyle)
4046

4147
@JvmStatic
48+
@JvmOverloads
4249
fun from(texts: List<Text>, textStyle: TextStyle? = null): Text = ArrayText(*texts.toTypedArray(), textStyle = textStyle)
4350

4451
}

0 commit comments

Comments
 (0)