java.lang.Object
io.jenetics.jpx.Route.Builder
- Enclosing class:
- Route
Builder class for building
Route objects.
final Route route = Route.builder()
.name("Route 1")
.description("Fancy mountain-bike tour.")
.addPoint(p -> p.lat(48.2081743).lon(16.3738189).ele(160))
.addPoint(p -> p.lat(48.2081743).lon(16.3738189).ele(161))
.addPoint(p -> p.lat(48.2081743).lon(16.3738189).ele(162))))
.build();-
Method Summary
Modifier and TypeMethodDescriptionSet the links to external information about the route.Set the links to external information about the route.Adds a way-point to the route.addPoint(Consumer<? super WayPoint.Builder> point) Add a new way-point via the givenWayPoint.Builderclass.build()Create a newRouteobject with the set values.cmt()Return the current comment value.Set the route comment.desc()Return the current description value.Set the route description.Return the current extensionsextensions(Document extensions) Sets the extensions object, which may benull.Return a filter consisting of the elements of this filter that matches the given predicate.Return a filter consisting of the results of replacing each element with the contents of the mapped elements.links()Return the current links.Set the links to additional information about the route.Return a filter with the results of the applying given mapper function.Return a filter with the results of applying the given mapper function.name()Return the current name value.Set the route name.number()Return the current number value.number(int number) Set the GPS route number.Set the GPS route number.points()Return the current way-points.Sets the way-points of the route.src()Return the current source value.Set the source of the data.type()Return the current type value.Set the type (classification) of the route.
-
Method Details
-
name
Set the route name.- Parameters:
name- the route name.- Returns:
thisBuilderfor method chaining
-
name
Return the current name value.- Returns:
- the current name value
- Since:
- 1.1
-
cmt
Set the route comment.- Parameters:
comment- the route comment- Returns:
thisBuilderfor method chaining
-
cmt
Return the current comment value.- Returns:
- the current comment value
- Since:
- 1.1
-
desc
Set the route description.- Parameters:
description- the route description- Returns:
thisBuilderfor method chaining
-
desc
Return the current description value.- Returns:
- the current description value
- Since:
- 1.1
-
src
Set the source of the data. Included to give user some idea of reliability and accuracy of data.- Parameters:
source- the source of the data- Returns:
thisBuilderfor method chaining
-
src
Return the current source value.- Returns:
- the current source value
- Since:
- 1.1
-
links
Set the links to additional information about the route. The link list may benull.- Parameters:
links- the links to additional information about the route- Returns:
thisBuilderfor method chaining- Throws:
NullPointerException- if one of the links in the list isnull
-
addLink
Set the links to external information about the route.- Parameters:
link- the links to external information about the route.- Returns:
thisBuilderfor method chaining- Throws:
NullPointerException- if the givenlinkisnull
-
addLink
Set the links to external information about the route.- Parameters:
href- the links to external information about the route.- Returns:
thisBuilderfor method chaining- Throws:
NullPointerException- if the givenhrefisnullIllegalArgumentException- if the givenhrefis not a valid URL
-
links
Return the current links. The returned link list is mutable.- Returns:
- the current links
- Since:
- 1.1
-
number
Set the GPS route number.- Parameters:
number- the GPS route number- Returns:
thisBuilderfor method chaining
-
number
Set the GPS route number.- Parameters:
number- the GPS route number- Returns:
thisBuilderfor method chaining
-
number
Return the current number value.- Returns:
- the current number value
- Since:
- 1.1
-
type
Set the type (classification) of the route.- Parameters:
type- the type (classification) of the route.- Returns:
thisBuilderfor method chaining
-
type
Return the current type value.- Returns:
- the current type value
- Since:
- 1.1
-
extensions
Sets the extensions object, which may benull. The root element of the extensions document must beextensions.<extensions> ... </extensions>- Parameters:
extensions- the document- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the root element is not the anextensionsnode- Since:
- 1.5
-
extensions
Return the current extensions- Returns:
- the extensions document
- Since:
- 1.5
-
points
Sets the way-points of the route. The way-point list may benull.- Parameters:
points- the way-points- Returns:
thisBuilderfor method chaining- Throws:
NullPointerException- if one of the way-points isnull
-
addPoint
Adds a way-point to the route.- Parameters:
point- the way-point which is added to the route- Returns:
thisBuilderfor method chaining- Throws:
NullPointerException- if thepointisnull
-
addPoint
Add a new way-point via the givenWayPoint.Builderclass.- Parameters:
point- the way-point builder- Returns:
thisBuilderfor method chaining
-
points
Return the current way-points. The returned list is mutable.- Returns:
- the current, mutable way-point list
- Since:
- 1.1
-
filter
Description copied from interface:FilterReturn a filter consisting of the elements of this filter that matches the given predicate. -
map
Description copied from interface:FilterReturn a filter with the results of applying the given mapper function. -
flatMap
Description copied from interface:FilterReturn a filter consisting of the results of replacing each element with the contents of the mapped elements. -
listMap
Description copied from interface:FilterReturn a filter with the results of the applying given mapper function. -
build
Create a newRouteobject with the set values.
-