package com.github.solairerove.woodstock.domain;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

/**
 * Created by krivitski-no on 10/1/16.
 */
@Data
@Document
public class Task implements Serializable {
    @Id
    private String id;
    private String question;
    private Boolean enable;
    private Boolean correct;
    private Iterable<? extends Ticket> tickets = new ArrayList<>();

    public Task() {
    }

    public Task(String question, Collection<? extends Ticket> tickets) {
        this.question = question;
        this.enable = Boolean.TRUE;
        this.correct = Boolean.FALSE;
        this.tickets = tickets;
    }

    public Task(String question, Boolean enable, Boolean correct, Collection<? extends Ticket> tickets) {
        this.question = question;
        this.enable = enable;
        this.correct = correct;
        this.tickets = tickets;
    }
}

@@ -67,147 +67,8 @@
 ta;%0A
-import org.springframework.data.annotation.Id;%0Aimport org.springframework.data.mongodb.core.mapping.Document;%0A%0Aimport java.io.Serializable;
 %0Aimp
@@ -179,18 +179,8 @@
 ata%0A
-@Document%0A
 publ
@@ -197,149 +197,52 @@
 ask 
-implements Serializable %7B%0A    @Id%0A    private String id;%0A    private String question;%0A    private Boolean enable;%0A    private Boolean correct
+extends Block %7B%0A%0A    private String question
 ;%0A  
@@ -455,25 +455,59 @@
    this.
-e
+tickets = tickets;%0A        super.setE
 nable
- = 
+(
 Boolean.
@@ -510,16 +510,17 @@
 ean.TRUE
+)
 ;%0A      
@@ -521,31 +521,33 @@
         
-this.c
+super.setC
 orrect
- = 
+(
 Boolean.
@@ -555,40 +555,9 @@
 ALSE
-;%0A        this.tickets = tickets
+)
 ;%0A  
@@ -597,41 +597,8 @@
 ion,
- Boolean enable, Boolean correct,
  Col
@@ -622,32 +622,65 @@
  Ticket%3E tickets
+, Boolean enable, Boolean correct
 ) %7B%0A        this
@@ -718,87 +718,93 @@
 his.
-enable = enable;%0A        this.correct = correct;%0A        this.tickets = tickets
+tickets = tickets;%0A        super.setEnable(enable);%0A        super.setCorrect(correct)
 ;%0A  

Implement task model inheritance