Class GeoCircle.Builder

    • Method Detail

      • validate

        protected Validator validate​(Validator problems)
        Description copied from class: EField.Builder
        This method should be overridden by subclass message builders and called before doing its own validation. The first line in the subclass validate implementation should be super.validate(problems);.

        When overriding this method, be sure to add all discovered validation problems to the list. The validation method should consist of a series of individual if statements and not an if/else if chain. That way all problems are found and not just the first one.

        Please see Validator for an example of how to validate Builder settings.

        Overrides:
        validate in class EField.Builder<GeoCircle>
        Parameters:
        problems - used to check field validity and collect discovered invalid fields.
        Returns:
        problems to allow for method chaining.
        See Also:
        Validator
      • center

        public GeoCircle.Builder center​(Position center)
        Sets GeoJSON circle's center coordinate.
        Parameters:
        center - circle's center.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if center is null.
      • radius

        public GeoCircle.Builder radius​(java.math.BigDecimal radius)
        Sets GeoJSON circle's radius. Must be > zero.
        Parameters:
        radius - circle's radius.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if radius is null.
        java.lang.IllegalArgumentException - if radius ≤ zero.
      • radiusUnits

        public GeoCircle.Builder radiusUnits​(java.lang.String units)
        Sets GeoJSON circle's radius units. Please note that units may be set to any non-null, non-empty text value.

        Defaults to GeoCircle.DEFAULT_RADIUS_UNITS if not set.

        Parameters:
        units - radius units.
        Returns:
        this Builder instance.
        Throws:
        java.lang.IllegalArgumentException - if units is either null or an empty string.