11package ru.endlesscode.inspector.report
22
3- interface ReportField {
3+ public interface ReportField {
44
5- companion object {
5+ public companion object {
66 private const val HIDDEN_FIELD_VALUE = " <value hidden by user>"
77 }
88
9- val name: String
10- val shortValue: String
11- val value: String
12- val show: Boolean
9+ public val name: String
10+ public val shortValue: String
11+ public val value: String
12+ public val show: Boolean
1313
14- fun render (
14+ public fun render (
1515 short : Boolean = true,
1616 separator : String = ": ",
1717 prepareName : (String ) -> String = { it },
18- prepareValue : (String ) -> String = { it }
18+ prepareValue : (String ) -> String = { it },
1919 ): String {
2020 val selectedValue = if (show) {
2121 if (short) shortValue else value
@@ -27,10 +27,10 @@ interface ReportField {
2727 }
2828}
2929
30- open class TextField (
30+ public open class TextField (
3131 override val name : String ,
3232 override val shortValue : String ,
33- override val value : String = shortValue
33+ override val value : String = shortValue,
3434) : ReportField {
3535
3636 private var shouldShow: TextField .() -> Boolean = { true }
@@ -39,16 +39,16 @@ open class TextField(
3939 get() = shouldShow()
4040
4141 /* * Adds predicate to show or hide field. */
42- fun showOnlyIf (predicate : TextField .() -> Boolean ): ReportField {
42+ public fun showOnlyIf (predicate : TextField .() -> Boolean ): ReportField {
4343 shouldShow = predicate
4444 return this
4545 }
4646}
4747
48- open class ListField <T >(
48+ public open class ListField <T >(
4949 override val name : String ,
5050 private val produceList : () -> List <T >,
51- private val getSummary : (List <T >) -> String
51+ private val getSummary : (List <T >) -> String ,
5252) : ReportField {
5353
5454 override val shortValue: String
@@ -66,7 +66,7 @@ open class ListField<T>(
6666 private var shouldShow: ListField <T >.() -> Boolean = { true }
6767
6868 /* * Adds predicate to show or hide field. */
69- fun showOnlyIf (predicate : ListField <T >.() -> Boolean ): ListField <T > {
69+ public fun showOnlyIf (predicate : ListField <T >.() -> Boolean ): ListField <T > {
7070 shouldShow = predicate
7171 return this
7272 }
0 commit comments