/*
 * Person.java
 *
 * Created on 28 novembre 2006, 15:26
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package com.developpez.dejardin.nodb;

import java.io.Serializable;


/**
 *
 * @author valere dejardin
 */
public class Person implements Comparable, Serializable {
    private static final long serialVersionUID = 1L;
    private int id;
    private String name;
    private String function;
    private boolean frequentFlier;
    
    /** Creates a new instance of Person */
    public Person() {
    }

    /** Creates a new instance of Person */
    public Person(int id, String name, String function, boolean frequentFlier) {
        this.id = id;
        this.name = name;
        this.function = function;
        this.frequentFlier = frequentFlier;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFunction() {
        return function;
    }

    public void setFunction(String function) {
        this.function = function;
    }

    public boolean isFrequentFlier() {
        return frequentFlier;
    }

    public void setFrequentFlier(boolean frequentFlier) {
        this.frequentFlier = frequentFlier;
    }

    public int compareTo(Object o) {
        return compareTo((Person) o);
    }

    public int compareTo(Person person) {
        return (this.name.toLowerCase()).compareTo(person.getName().toLowerCase());
    }
}
