Package huskymaps

Class 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()
                 .setLon(...)
                 .setLat(...);
         ...
         builder.setName(...);
         Location result = builder.build();
     
    See Also:
    Location
    • Field Detail

      • lon

        private double lon
      • lat

        private double lat
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setLon

        public Location.Builder setLon​(double lon)
        Sets the longitude for this builder.
        Parameters:
        lon - the longitude.
        Returns:
        this builder.
      • setLat

        public Location.Builder setLat​(double lat)
        Sets the latitude for this builder.
        Parameters:
        lat - the latitude.
        Returns:
        this builder.
      • setName

        public Location.Builder setName​(String name)
        Sets the name for this builder.
        Parameters:
        name - the name.
        Returns:
        this builder.
      • build

        public Location build()
        Returns a new Location from the fields of this builder.
        Returns:
        Returns a new Location from the fields of this builder.