package com.ibtp.kontor.comics.entity;

import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.Property;
import org.mongodb.morphia.annotations.Reference;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by thomas on 01.03.16.
 */
public class Volume {

    public Volume() {}

    public Volume(String name) {
        setName(name);
    }

    @Id
    private ObjectId id;

    @Property
    private String name;

    @Reference
    private Comic comic;

    @Reference
    private List<Issue> issues = new ArrayList<Issue>();

    public ObjectId getId() {
        return id;
    }

    public void setId(ObjectId id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Comic getComic() {
        return comic;
    }

    public void setComic(Comic comic) {
        this.comic = comic;
    }

    public List<Issue> getIssues() {
        return issues;
    }

    public void setIssues(List<Issue> issues) {
        this.issues = issues;
    }

    @Override
    public String toString() {
        return name;
    }
}
