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

com.what3words.javawrapper.request.GridSectionGeoJsonRequest Maven / Gradle / Ivy

The newest version!
package com.what3words.javawrapper.request;

import com.what3words.javawrapper.What3WordsJavaWrapper;
import com.what3words.javawrapper.response.GridSectionGeoJson;

public class GridSectionGeoJsonRequest extends Request {
    private String boundingBox;

    private GridSectionGeoJsonRequest(Builder builder) {
        super(builder.api);
        boundingBox = builder.boundingBox;
    }

    private GridSectionGeoJson execute() {
        return super.execute(api.what3words().gridSectionGeoJson(boundingBox, "geojson"), GridSectionGeoJson.class);
    }

    public static class Builder extends AbstractBuilder {
        private String boundingBox;

        public Builder(What3WordsJavaWrapper api, BoundingBox boundingBox) {
            super(api);
            this.boundingBox = String.valueOf(boundingBox.sw.lat) + "," + String.valueOf(boundingBox.sw.lng) + "," +
                    String.valueOf(boundingBox.ne.lat) + "," + String.valueOf(boundingBox.ne.lng);
        }

        public GridSectionGeoJson execute() {
            return new GridSectionGeoJsonRequest(this).execute();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy