com.what3words.javawrapper.request.ConvertTo3WARequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of w3w-java-wrapper Show documentation
Show all versions of w3w-java-wrapper Show documentation
Java library for what3words REST API.
package com.what3words.javawrapper.request;
import com.what3words.javawrapper.What3WordsV3;
import com.what3words.javawrapper.response.ConvertTo3WA;
public class ConvertTo3WARequest extends Request {
private String coordinates;
private String language;
private ConvertTo3WARequest(Builder builder) {
super(builder.api);
coordinates = builder.coordinates;
language = builder.language;
}
private ConvertTo3WA execute() {
return super.execute(api.what3words().convertTo3wa(coordinates, language), ConvertTo3WA.class);
}
public static class Builder extends AbstractBuilder {
private String coordinates;
private String language;
public Builder(What3WordsV3 api, Coordinates coordinates) {
super(api);
this.coordinates = String.valueOf(coordinates.lat) + "," + String.valueOf(coordinates.lng);
}
public Builder language(String language) {
this.language = language;
return this;
}
public ConvertTo3WA execute() {
return new ConvertTo3WARequest(this).execute();
}
}
}