com.logicommerce.sdk.builders.LocationBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
SDK for developing Logicommerce plugins.
package com.logicommerce.sdk.builders;
import com.logicommerce.sdk.models.Location;
import com.logicommerce.sdk.models.implementations.LocationImpl;
/**
* LocationBuilder class.
*
* @author Logicommerce
* @since 1.0.16
*/
public class LocationBuilder {
private T parentBuilder;
protected String country;
protected Integer locationId;
protected Double latitude = 0d;
protected Double longitude = 0d;
protected String stateCode;
protected String name;
/**
* Constructor for LocationBuilder.
*/
public LocationBuilder() {}
/**
* Constructor for LocationBuilder.
*
* @param parentBuilder a T object
*/
public LocationBuilder(T parentBuilder) {
this();
this.parentBuilder = parentBuilder;
}
/**
* country.
*
* @param country a {@link java.lang.String} object
* @return a {@link com.logicommerce.sdk.builders.LocationBuilder} object
*/
public LocationBuilder country(String country) {
this.country = country;
return this;
}
/**
* locationId.
*
* @param locationId a {@link java.lang.Integer} object
* @return a {@link com.logicommerce.sdk.builders.LocationBuilder} object
*/
public LocationBuilder locationId(Integer locationId) {
this.locationId = locationId;
return this;
}
/**
* latitude.
*
* @param latitude a {@link java.lang.Double} object
* @return a {@link com.logicommerce.sdk.builders.LocationBuilder} object
*/
public LocationBuilder latitude(Double latitude) {
this.latitude = latitude;
return this;
}
/**
* longitude.
*
* @param longitude a {@link java.lang.Double} object
* @return a {@link com.logicommerce.sdk.builders.LocationBuilder} object
*/
public LocationBuilder longitude(Double longitude) {
this.longitude = longitude;
return this;
}
/**
* stateCode.
*
* @param stateCode a {@link java.lang.String} object
* @return a {@link com.logicommerce.sdk.builders.LocationBuilder} object
*/
public LocationBuilder stateCode(String stateCode) {
this.stateCode = stateCode;
return this;
}
/**
* name.
*
* @param name a {@link java.lang.String} object
* @return a {@link com.logicommerce.sdk.builders.LocationBuilder} object
*/
public LocationBuilder name(String name) {
this.name = name;
return this;
}
/**
* build.
*
* @return a {@link com.logicommerce.sdk.models.Location} object
*/
public Location build() {
LocationImpl location = new LocationImpl();
location.setCountry(country);
location.setLocationId(locationId);
location.setLatitude(latitude);
location.setLongitude(longitude);
location.setStateCode(stateCode);
location.setName(name);
return location;
}
/**
* done.
*
* @return a T object
*/
public T done() {
return parentBuilder;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy