package de.refugeehackathon.transit;

public class Geometry {
    public final double[] coordinates;

    public Geometry(double[] coordinates) {
        this.coordinates = coordinates;
    }

    public double getLongitude() {
        return coordinates[0];
    }

    public double getLatitude() {
        return coordinates[1];
    }

}

package de.refugeehackathon.transit;

import android.support.annotation.FloatRange;

public class Geometry {
    public final double[] coordinates;

    public Geometry(double[] coordinates) {
        this.coordinates = coordinates;
    }

    public
    @FloatRange(from = -180, to = 180)
    double getLongitude() {
        return coordinates[0];
    }

    public
    @FloatRange(from = -90, to = 90)
    double getLatitude() {
        return coordinates[1];
    }

}

Annotate getters with range.