/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.semtox.bemyeye.api.data;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Semtox
 */
@XmlRootElement
public class Person {
    //@XmlAttribute
    private int id;

    //@XmlAttribute
    private int stream;

    //@XmlAttribute
    private String key;

    //@XmlAttribute(required=true)
    private String name;

    //@XmlAttribute(required=true)
    private int phone;

    public Person() {
    }

    public Person(int id, int stream, String key) {
        this.id = id;
        this.stream = stream;
        this.key = key;
    }

    public Person(int id, int stream, String key, String name, int phone) {
        this.id = id;
        this.stream = stream;
        this.key = key;
        this.name = name;
        this.phone = phone;
    }
    
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }

    public int getStream() {
        return stream;
    }
    public void setStream(int stream) {
        this.stream = stream;
    }

    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public int getPhone() {
        return phone;
    }
    public void setPhone(int phone) {
        this.phone = phone;
    }

    public boolean isFull(){
        return name != null && phone > 0;
    }
    
    @Override
    public int hashCode() {
        int hash = 3;
        hash = 29 * hash + this.id;
        hash = 29 * hash + this.stream;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Person other = (Person) obj;
        if (this.id != other.id) {
            return false;
        }
        if (this.stream != other.stream) {
            return false;
        }
        return true;
    }
    
    
}
