package com.pm.server.datatype;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class CoordinateImpl implements Coordinate {

	private Double latitude;
	private Double longitude;

	private final static Logger log =
			LogManager.getLogger(CoordinateImpl.class.getName());

	public CoordinateImpl() {
		log.trace(
				"Creating coordinate with latitude and longitude 0.0."
		);
		reset();
	}

	public void reset() {
		latitude = 0.0;
		longitude = 0.0;
	}

	public CoordinateImpl(Double latitude, Double longitude) {

		log.trace(
				"Creating coordinate with latitude {} and longitude {}",
				latitude, longitude
		);

		this.latitude = latitude;
		this.longitude = longitude;
	}

	@Override
	public boolean equals(Object object) {

		if(object == null) {
			return false;
		}

		if(!CoordinateImpl.class.isAssignableFrom(object.getClass())) {
			return false;
		}
		final CoordinateImpl coordinateCompare = (CoordinateImpl) object;
		if(this.latitude != coordinateCompare.latitude) {
			return false;
		}
		else if(this.longitude != coordinateCompare.longitude) {
			return false;
		}

		return true;

	}

	public void setLatitude(Double latitude) {

		log.trace("Setting latitude to {}", latitude);

		this.latitude = latitude;
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLongitude(Double longitude) {

		log.trace("Setting longitude to {}", longitude);

		this.longitude = longitude;
	}

	public Double getLongitude() {
		return longitude;
	}

}

@@ -434,72 +434,8 @@
 %09%7D%0A%0A
-%09public void reset() %7B%0A%09%09latitude = 0.0;%0A%09%09longitude = 0.0;%0A%09%7D%0A%0A
 %09pub
@@ -657,16 +657,359 @@
 de;%0A%09%7D%0A%0A
+%09public CoordinateImpl(Coordinate coordinate) %7B%0A%0A%09%09log.trace(%0A%09%09%09%09%22Creating coordinate with latitude %7B%7D and longitude %7B%7D%22,%0A%09%09%09%09coordinate.getLatitude(), coordinate.getLongitude()%0A%09%09);%0A%0A%09%09this.latitude = coordinate.getLatitude();%0A%09%09this.longitude = coordinate.getLongitude();%0A%09%7D%0A%0A%09public void reset() %7B%0A%09%09latitude = 0.0;%0A%09%09longitude = 0.0;%0A%09%7D%0A%0A
 %09@Overri

Add copy constructor for CoordinateImpl