Class GeoEllipse.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<GeoEllipse>
        Parameters:
        problems - used to check field validity and collect discovered invalid fields.
        Returns:
        problems to allow for method chaining.
        See Also:
        Validator
      • center

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

        public GeoEllipse.Builder majorAxis​(java.math.BigDecimal axis)
        Sets GeoJSON ellipse's major axis. Must be > zero.
        Parameters:
        axis - ellipse major axis.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if axis is null.
        java.lang.IllegalArgumentException - if axis ≤ zero.
      • minorAxis

        public GeoEllipse.Builder minorAxis​(java.math.BigDecimal axis)
        Sets GeoJSON ellipse's minor axis. Must be > zero.
        Parameters:
        axis - ellipse minor axis.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if axis is null.
        java.lang.IllegalArgumentException - if axis ≤ zero.
      • rotation

        public GeoEllipse.Builder rotation​(java.math.BigDecimal rotation)
        Sets GeoJSON ellipse's rotation. Must by ≥ zero.
        Parameters:
        rotation - ellipse rotation.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if rotation is null.
        java.lang.IllegalArgumentException - if rotation < zero.
      • axisUnits

        public GeoEllipse.Builder axisUnits​(java.lang.String units)
        Sets GeoJSON ellipse's axis units. Please note that units may be set to any non-null, non-empty text value.

        Defaults to GeoEllipse.DEFAULT_AXIS_UNITS if not set.

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

        public GeoEllipse.Builder rotationUnits​(java.lang.String units)
        Sets GeoJSON ellipse's rotation units. Please note that units may be set to any non-null, non-empty text value.

        Defaults to GeoEllipse.DEFAULT_ROTATION_UNITS if not set.

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