Skip to content

Instantly share code, notes, and snippets.

@le0nidas
Created October 28, 2018 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save le0nidas/a723f30888476adf75b9058a17034d1b to your computer and use it in GitHub Desktop.
Save le0nidas/a723f30888476adf75b9058a17034d1b to your computer and use it in GitHub Desktop.
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