Class BoundingBox.Builder

  • Enclosing class:
    BoundingBox

    public static final class BoundingBox.Builder
    extends EField.Builder<BoundingBox>
    A Builder instance is the only was to create a BoundingBox instance. The only way to obtain a Builder instance is via BoundingBox.builder(). Use the builder instance to set the bounding box latitude and longitude points and then call EMessageObject.Builder.build() to generate the bounding box instance.

    It is recommended that a new builder instance be used for each new bounding box instance. Builder instance re-use is discouraged.

    • Method Detail

      • validate

        protected Validator validate​(Validator problems)
        Checks if:
        1. all four bounding box points are set,
        2. minimum latitude ≤ maximum latitude, and
        3. minimum longitude ≤ maximum longitude.
        Overrides:
        validate in class EField.Builder<BoundingBox>
        Parameters:
        problems - add each detected problem to this validator.
        Returns:
        problem
        See Also:
        Validator
      • minLatitude

        public BoundingBox.Builder minLatitude​(java.math.BigDecimal min)
        Sets southern bounding box latitude. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        min - southern or minimum latitude.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if min is null.
        java.lang.IllegalArgumentException - if min < GeoObject.MIN_LATITUDE or > GeoObject.MAX_LATITUDE.
      • maxLatitude

        public BoundingBox.Builder maxLatitude​(java.math.BigDecimal max)
        Sets northern bounding box latitude. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        max - northern or maximum latitude.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if max is null.
        java.lang.IllegalArgumentException - if max < GeoObject.MIN_LATITUDE or > GeoObject.MAX_LATITUDE.
      • minLongitude

        public BoundingBox.Builder minLongitude​(java.math.BigDecimal min)
        Sets western bounding box longitude. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        min - western or minimum latitude.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if min is null.
        java.lang.IllegalArgumentException - if min < GeoObject.MIN_LONGITUDE or > GeoObject.MAX_LONGITUDE.
      • maxLongitude

        public BoundingBox.Builder maxLongitude​(java.math.BigDecimal max)
        Sets eastern bounding box longitude. Returns this Builder instance so that builder method calls can be chained.
        Parameters:
        max - eastern or maximum latitude.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if max is null.
        java.lang.IllegalArgumentException - if max < GeoObject.MIN_LONGITUDE or > GeoObject.MAX_LONGITUDE.