Newer
Older
mountainnavigation / app / src / main / java / de / apps4ics / mountainnavigation / pois / Poi.java
package de.apps4ics.mountainnavigation.pois;

/**
 * Created by Vinz on 06.10.2015.
 */
public class Poi {
    protected long _id;
    protected int _type;
    protected DbGeoPoint gp;
    protected long gpId;

    public Poi() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Poi poi = (Poi) o;

        if (_id != poi._id) return false;
        if (_type != poi._type) return false;
        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) _id;
        result = 31 * result + _type;
        return result;
    }

    public long getGpId(){
        return gpId;
    }

    public DbGeoPoint getGp(){
        return gp;
    }

    public void setGpId(long gpId){
        this.gpId = gpId;
    }

    public void setGp(DbGeoPoint gp){
        this.gp = gp;
        this.gpId = gp.getId();
    }

    public Poi(int _type){
        this._type = _type;
    }

    public Poi(long _id, int _type){
        this._id = _id;
        this._type = _type;
    }

    public Poi(long _id, int _type, DbGeoPoint _gp){
        this(_id, _type);
        if(_gp != null){
            this.gp = _gp;
            this.gpId = _gp.getId();
        }
    }

    public long getId(){
        return _id;
    }

    @Override
    public String toString() {
        return "Poi {" +
                "_id=" + _id +
                ", _type=" + _type +
                '}';
    }

    public int getType(){
        return _type;
    }

}