Package huskymaps
Class Location.Builder
- java.lang.Object
-
- huskymaps.Location.Builder
-
- Enclosing class:
- Location
public static class Location.Builder extends Object
Interactively constructs a new location when the fields are not all immediately available.Location.Builder builder = new Location.Builder() .setLat(...) .setLon(...); ... builder.setName(...); Location result = builder.build();
- See Also:
Location
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Location
build()
Returns a newLocation
from the fields of this builder.Location.Builder
setLat(double lat)
Sets the latitude for this builder.Location.Builder
setLon(double lon)
Sets the longitude for this builder.Location.Builder
setName(String name)
Sets the name for this builder.
-
-
-
Field Detail
-
lat
private double lat
-
lon
private double lon
-
name
private String name
-
-
Method Detail
-
setLat
public Location.Builder setLat(double lat)
Sets the latitude for this builder.- Parameters:
lat
- the latitude.- Returns:
- this builder.
-
setLon
public Location.Builder setLon(double lon)
Sets the longitude for this builder.- Parameters:
lon
- the longitude.- Returns:
- this builder.
-
setName
public Location.Builder setName(String name)
Sets the name for this builder.- Parameters:
name
- the name.- Returns:
- this builder.
-
-