Package net.sf.eBusx.geo
Class GeoEllipse.Builder
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject.Builder<M>
-
- net.sf.eBus.messages.EField.Builder<F>
-
- net.sf.eBusx.geo.GeoObject.GeoBuilder<GeoEllipse,GeoEllipse.Builder>
-
- net.sf.eBusx.geo.GeoEllipse.Builder
-
- Enclosing class:
- GeoEllipse
public static final class GeoEllipse.Builder extends GeoObject.GeoBuilder<GeoEllipse,GeoEllipse.Builder>
Builder class used to create GeoJSON ellipse instance. ABuilder
instance is obtained by callingGeoEllipse.builder()
method.- See Also:
GeoEllipse.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 GeoEllipse.Builder
axisUnits(java.lang.String units)
Sets GeoJSON ellipse's axis units.protected GeoEllipse
buildImpl()
Returns eBus message instance built from the configured properties.GeoEllipse.Builder
center(Position center)
Sets GeoJSON ellipse's center coordinate.GeoEllipse.Builder
majorAxis(java.math.BigDecimal axis)
Sets GeoJSON ellipse's major axis.GeoEllipse.Builder
minorAxis(java.math.BigDecimal axis)
Sets GeoJSON ellipse's minor axis.GeoEllipse.Builder
rotation(java.math.BigDecimal rotation)
Sets GeoJSON ellipse's rotation.GeoEllipse.Builder
rotationUnits(java.lang.String units)
Sets GeoJSON ellipse's rotation units.protected GeoEllipse.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 GeoEllipse.Builder self()
Description copied from class:GeoObject.GeoBuilder
Returns subclass instance.- Specified by:
self
in classGeoObject.GeoBuilder<GeoEllipse,GeoEllipse.Builder>
- Returns:
- builder instance reference.
-
buildImpl
protected GeoEllipse 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<GeoEllipse>
- 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<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
- ifcenter
isnull
.
-
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
- ifaxis
isnull
.java.lang.IllegalArgumentException
- ifaxis
≤ 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
- ifaxis
isnull
.java.lang.IllegalArgumentException
- ifaxis
≤ 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
- ifrotation
isnull
.java.lang.IllegalArgumentException
- ifrotation
< zero.
-
axisUnits
public GeoEllipse.Builder axisUnits(java.lang.String units)
Sets GeoJSON ellipse's axis units. Please note thatunits
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
- ifunits
is eithernull
or an empty string.
-
rotationUnits
public GeoEllipse.Builder rotationUnits(java.lang.String units)
Sets GeoJSON ellipse's rotation units. Please note thatunits
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
- ifunits
is eithernull
or an empty string.
-
-