Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. data class SingleEventMessage(
  2. private var initialValue: String = ""
  3. ) {
  4.  
  5. var value: String = initialValue
  6. private set
  7. get() {
  8. if (initialValue.isEmpty())
  9. return ""
  10.  
  11. if (initialValue.isNotEmpty() && field.isNotEmpty()) {
  12. val returnValue = field
  13. value = ""
  14. initialValue = ""
  15. return returnValue
  16. } else {
  17. return ""
  18. }
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement