Skip to content

Instantly share code, notes, and snippets.

@le0nidas

le0nidas/uglytask.kt Secret

Created Oct 28, 2018
Embed
What would you like to do?
class UglyTask(
  val name: String,
  val assignedUser: User? = null,
  val assignedGroup: Group? = null
) {
  init {
  if (assignedUser != null && assignedGroup != null) {
  throw IllegalArgumentException("a task can be assigned to either a user OR a group.")
  }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment