package net.bounceme.chronos.utils.calc.dto;

import java.util.Objects;

public class PolarPoint {
    
    private Double r;
    private Double angle;
    
    public PolarPoint() {
        super();
    }

    public PolarPoint(Double r, Double angle) {
        this.r = r;
        this.angle = angle;
    }

    /**
     * @return the r
     */
    public Double getR() {
        return r;
    }

    /**
     * @param r the r to set
     */
    public void setR(Double r) {
        this.r = r;
    }

    /**
     * @return the angle
     */
    public Double getAngle() {
        return angle;
    }

    /**
     * @param angle the angle to set
     */
    public void setAngle(Double angle) {
        this.angle = angle;
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return Objects.hash(angle, r);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof PolarPoint)) {
			return false;
		}
		PolarPoint other = (PolarPoint) obj;
		return Objects.equals(angle, other.angle) && Objects.equals(r, other.r);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("PolarPoint [");
		if (r != null) {
			builder.append("r=");
			builder.append(r);
			builder.append(", ");
		}
		if (angle != null) {
			builder.append("angle=");
			builder.append(angle);
		}
		builder.append("]");
		return builder.toString();
	}
    
}
