Class Position.Builder

  • Enclosing class:
    Position

    public static final class Position.Builder
    extends EField.Builder<Position>
    Position instances may be created only by using a Builder instance. A Builder instance is obtained by calling Position.builder() which returns a newly instantiated builder instance. Once obtained, call the setter methods for each field and EMessageObject.Builder.build() to create a Position instance.
    • Method Detail

      • validate

        protected Validator validate​(Validator problems)
        Checks if latitude and longitude are set. Elevation may be null.
        Overrides:
        validate in class EField.Builder<Position>
        Parameters:
        problems - add each detected problem to this validator.
        Returns:
        problems.
        See Also:
        Validator
      • latitude

        public Position.Builder latitude​(java.math.BigDecimal latitude)
        Sets position latitude. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        latitude - position latitude.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if position is null.
        java.lang.IllegalArgumentException - if latitude < GeoObject.MIN_LATITUDE or > GeoObject.MAX_LATITUDE.
      • longitude

        public Position.Builder longitude​(java.math.BigDecimal longitude)
        Sets position longitude. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        longitude - position longitude.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if longitude is null.
        java.lang.IllegalArgumentException - if longitude < GeoObject.MIN_LONGITUDE or > GeoObject.MAX_LONGITUDE.
      • elevation

        public Position.Builder elevation​(java.math.BigDecimal elevation)
        Sets position elevation. Returns this Builder instance so that builder method calls can be chained. May be set to null. All values are accepted.
        Parameters:
        elevation - position elevation.
        Returns:
        this Builder instance.