package cz.utb.tadis.map.model;

import javax.persistence.*;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Entity
@Table(name = "map_settings")
public class MapSettings {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotNull
    @DecimalMin("-90")
    @DecimalMax("90")
    private BigDecimal centerLatitude;

    @NotNull
    @DecimalMin("-180")
    @DecimalMax("180")
    private BigDecimal centerLongitude;

    @NotNull
    @DecimalMin("0")
    private BigDecimal zoom;

    public MapSettings() {
    }

    public MapSettings(@NotNull @DecimalMin("-90") @DecimalMax("90") BigDecimal centerLatitude, @NotNull @DecimalMin("-180") @DecimalMax("180") BigDecimal centerLongitude, @NotNull @DecimalMin("0") BigDecimal zoom) {
        this.centerLatitude = centerLatitude;
        this.centerLongitude = centerLongitude;
        this.zoom = zoom;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public BigDecimal getCenterLatitude() {
        return centerLatitude;
    }

    public void setCenterLatitude(BigDecimal centerLatitude) {
        this.centerLatitude = centerLatitude;
    }

    public BigDecimal getCenterLongitude() {
        return centerLongitude;
    }

    public void setCenterLongitude(BigDecimal centerLongitude) {
        this.centerLongitude = centerLongitude;
    }

    public BigDecimal getZoom() {
        return zoom;
    }

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