alex.hart
08/17/2017, 12:33 PMsealed class DString {
class Empty internal constructor() : DString()
class NonEmpty internal constructor(val s: String) : DString()
companion object {
fun create(s: String?) = if (s.isNullOrEmpty()) Empty() else NonEmpty(s!!)
}
}
“protected” and “private” don’t work.