All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.albertus82.jface.maps.MapOptions Maven / Gradle / Ivy

Go to download

Java SWT/JFace Utility Library including a Preferences Framework, Lightweight HTTP Server and macOS support.

There is a newer version: 20.1.0
Show newest version
package io.github.albertus82.jface.maps;

import java.io.Serializable;

public class MapOptions implements Serializable {

	private static final long serialVersionUID = 8324663629284543572L;

	public static final int DEFAULT_ZOOM = 1;

	private double centerLat;
	private double centerLng;
	private int zoom = DEFAULT_ZOOM;

	public MapOptions() {/* Default constructor */}

	public MapOptions(final double centerLat, final double centerLng, final int zoom) {
		this.centerLat = centerLat;
		this.centerLng = centerLng;
		this.zoom = zoom;
	}

	public double getCenterLat() {
		return centerLat;
	}

	public void setCenterLat(final double centerLat) {
		this.centerLat = centerLat;
	}

	public double getCenterLng() {
		return centerLng;
	}

	public void setCenterLng(final double centerLng) {
		this.centerLng = centerLng;
	}

	public int getZoom() {
		return zoom;
	}

	public void setZoom(final int zoom) {
		this.zoom = zoom;
	}

	@Override
	public String toString() {
		return "MapOptions [centerLat=" + centerLat + ", centerLng=" + centerLng + ", zoom=" + zoom + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(centerLat);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(centerLng);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + zoom;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof MapOptions)) {
			return false;
		}
		MapOptions other = (MapOptions) obj;
		if (Double.doubleToLongBits(centerLat) != Double.doubleToLongBits(other.centerLat)) {
			return false;
		}
		if (Double.doubleToLongBits(centerLng) != Double.doubleToLongBits(other.centerLng)) {
			return false;
		}
		if (zoom != other.zoom) { // NOSONAR Autogenerated method
			return false;
		}
		return true;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy