Getters and Setters in Kotlin
<p>In Java, for example, I can write getters on my own (generated by IDE) or use Annotations like @Getter in lombok - which was pretty simple.</p>

<p>Kotlin however has <a href="https://kotlinlang.org/docs/reference/properties.html" rel="noreferrer">getters and setters by default</a>.
But I can't understand how to use them.</p>

<p>I want to make it, lets say - similar to Java:</p>

<pre><code>private val isEmpty: String
        get() = this.toString() //making this thing public rises an error: Getter visibility must be the same as property visibility.
</code></pre>

<p>So how do getters work? </p>