/*
 * 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 lu;

/**
 *
 * @author User
 */
public class Head {
    private String firstName;
    private String lastName;
    private int age;
    private int jobType;

    public Head(String firstName, String lastName, int age, int jobType) {
        this.firstName = firstName;
        this.lastName = lastName;
        if(age<28 || age>64)
            System.out.println("Error age value");
        else
            this.age = age;
        if(jobType!=0 || jobType!=1)
            System.out.println("Error JobType value");
        else
            this.jobType = jobType;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if(age<28 || age>64)
            System.out.println("Error age value");
        else
            this.age = age;
    }

    public int getJobType() {
        return jobType;
    }

    public void setJobType(int jobType) {
        if(jobType!=0 || jobType!=1)
            System.out.println("Error JobType value");
        else
            this.jobType = jobType;
    }

    @Override
    public String toString() {
        return "[The employee name is " + firstName + " " + lastName + ", " + ((jobType==0)?"Administrative":"Technical") + ", age:"+((age>0)?age:"age not set");
    }
    
    
}
