Package net.sf.eBusx.geo
Class GeoCircle.Builder
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject.Builder<M>
-
- net.sf.eBus.messages.EField.Builder<F>
-
- net.sf.eBusx.geo.GeoObject.GeoBuilder<GeoCircle,GeoCircle.Builder>
-
- net.sf.eBusx.geo.GeoCircle.Builder
-
- Enclosing class:
- GeoCircle
public static final class GeoCircle.Builder extends GeoObject.GeoBuilder<GeoCircle,GeoCircle.Builder>
Builder class used to create GeoJSON circle instance. ABuilder
instance is obtained by callingGeoCircle.builder()
method.- See Also:
GeoCircle.builder()
-
-
Field Summary
-
Fields inherited from class net.sf.eBus.messages.EMessageObject.Builder
mTargetClass
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GeoCircle
buildImpl()
Returns eBus message instance built from the configured properties.GeoCircle.Builder
center(Position center)
Sets GeoJSON circle's center coordinate.GeoCircle.Builder
radius(java.math.BigDecimal radius)
Sets GeoJSON circle's radius.GeoCircle.Builder
radiusUnits(java.lang.String units)
Sets GeoJSON circle's radius units.protected GeoCircle.Builder
self()
Returns subclass instance.protected Validator
validate(Validator problems)
This method should be overridden by subclass message builders and called before doing its own validation.-
Methods inherited from class net.sf.eBusx.geo.GeoObject.GeoBuilder
boundingBox, type
-
Methods inherited from class net.sf.eBus.messages.EMessageObject.Builder
build
-
-
-
-
Method Detail
-
self
protected GeoCircle.Builder self()
Description copied from class:GeoObject.GeoBuilder
Returns subclass instance.- Specified by:
self
in classGeoObject.GeoBuilder<GeoCircle,GeoCircle.Builder>
- Returns:
- builder instance reference.
-
buildImpl
protected GeoCircle buildImpl()
Description copied from class:EMessageObject.Builder
Returns eBus message instance built from the configured properties. Note: the builder configuration wasvalidated
prior to calling this method. The message object may now be constructed.- Specified by:
buildImpl
in classEMessageObject.Builder<GeoCircle>
- Returns:
- target message class instance.
-
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 subclassvalidate
implementation should besuper.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 anif/else if
chain. That way all problems are found and not just the first one.Please see
Validator
for an example of how to validateBuilder
settings.- Overrides:
validate
in classEField.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
- ifcenter
isnull
.
-
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
- ifradius
isnull
.java.lang.IllegalArgumentException
- ifradius
≤ zero.
-
radiusUnits
public GeoCircle.Builder radiusUnits(java.lang.String units)
Sets GeoJSON circle's radius units. Please note thatunits
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
- ifunits
is eithernull
or an empty string.
-
-