package net.sevecek.dailyplanet;

import java.util.*;
import javax.validation.constraints.*;

public class Clanek {

    private UUID id;

    @Size(min = 1, max = 250)
    private String nazev;

    @NotNull
    private Autor autor;

    private int cisloRevize;

    @Deprecated
    public Clanek() {
    }

    public Clanek(UUID id) {
        if (id == null) {
            id = UUID.randomUUID();
        }
        this.id = id;
    }

    public Clanek(String nazev, Autor autor, int cisloRevize) {
        this.id = UUID.randomUUID();
        this.nazev = nazev;
        this.autor = autor;
        this.cisloRevize = cisloRevize;
    }

    public Clanek(UUID id, String nazev, Autor autor, int cisloRevize) {
        this(id);
        this.nazev = nazev;
        this.autor = autor;
        this.cisloRevize = cisloRevize;
    }

    public UUID getId() {
        return id;
    }

    @Deprecated
    public void setId(UUID newValue) {
        id = newValue;
    }

    public String getNazev() {
        return nazev;
    }

    public void setNazev(String newValue) {
        nazev = newValue;
    }

    public Autor getAutor() {
        return autor;
    }

    public void setAutor(Autor newValue) {
        autor = newValue;
    }

    public int getCisloRevize() {
        return cisloRevize;
    }

    public void setCisloRevize(int newValue) {
        cisloRevize = newValue;
    }

    @Override
    public String toString() {
        return "Clanek{" +
                "id=" + id +
                ", nazev='" + nazev + '\'' +
                ", autor=" + autor +
                ", cisloRevize=" + cisloRevize +
                '}';
    }
}
