java.lang.Object
io.jenetics.jpx.Metadata.Builder
- Enclosing class:
- Metadata
Builder class for creating immutable
Metadata objects.
Creating a GPX object with one track-segment and 3 track-points:
final Metadata gpx = Metadata.builder()
.author("Franz Wilhelmstötter")
.addLink(Link.of("http://jenetics.io"))
.build();-
Method Summary
Modifier and TypeMethodDescriptionAdd the givenlinkto the metadataAdd the givenlinkto the metadataauthor()Return the current author.Set the metadata author.Set the metadata author.bounds()Return the current bounds.Set the GPX bounds.build()Create an immutableMetadataobject from the current builder state.Return the current copyright info.Set the copyright info.desc()Return the current description.Set the metadata description.Return the current extensionsextensions(Document extensions) Sets the extensions object, which may benull.keywords()Return the current keywords.Set the metadata keywords.links()Return the current links.Set the metadata links.Adds the content of a givenMetadataobject.name()Return the current name.Set the metadata name.time()Return the currently set time.time(long millis) Set the time of the metadata.Set the time of the metadata
-
Method Details
-
metadata
Adds the content of a givenMetadataobject.- Parameters:
metadata- the metadata content- Returns:
thisBuilderfor method chaining
-
name
Set the metadata name.- Parameters:
name- the metadata name- Returns:
thisBuilderfor method chaining
-
name
Return the current name.- Returns:
- the current name
- Since:
- 1.3
-
desc
Set the metadata description.- Parameters:
description- the metadata description- Returns:
thisBuilderfor method chaining
-
desc
Return the current description.- Returns:
- the current description
- Since:
- 1.3
-
author
Set the metadata author.- Parameters:
author- the metadata author- Returns:
thisBuilderfor method chaining
-
author
Set the metadata author.- Parameters:
author- the metadata author- Returns:
thisBuilderfor method chaining
-
author
Return the current author.- Returns:
- the current author
- Since:
- 1.3
-
copyright
Set the copyright info.- Parameters:
copyright- the copyright info- Returns:
thisBuilderfor method chaining
-
copyright
Return the current copyright info.- Returns:
- the current copyright info
- Since:
- 1.3
-
links
Set the metadata links.- Parameters:
links- the metadata links- Returns:
thisBuilderfor method chaining
-
addLink
Add the givenlinkto the metadata- Parameters:
link- the link to add to the metadata- Returns:
thisBuilderfor method chaining
-
addLink
Add the givenlinkto the metadata- Parameters:
href- the link to add to the metadata- Returns:
thisBuilderfor method chaining- Throws:
IllegalArgumentException- if the givenhrefis not a valid URL
-
links
Return the current links.- Returns:
- the current links
- Since:
- 1.3
-
time
Set the time of the metadata- Parameters:
time- the time of the metadata- Returns:
thisBuilderfor method chaining
-
time
Set the time of the metadata.- Parameters:
millis- the instant to create the metadata time from- Returns:
thisBuilderfor method chaining
-
time
Return the currently set time.- Returns:
- the currently set time
- Since:
- 1.3
-
keywords
Set the metadata keywords.- Parameters:
keywords- the metadata keywords- Returns:
thisBuilderfor method chaining
-
keywords
Return the current keywords.- Returns:
- the current keywords
- Since:
- 1.3
-
bounds
Set the GPX bounds.- Parameters:
bounds- the GPX bounds- Returns:
thisBuilderfor method chaining
-
bounds
Return the current bounds.- Returns:
- the current bounds
- Since:
- 1.3
-
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
-
build
Create an immutableMetadataobject from the current builder state.- Returns:
- an immutable
Metadataobject from the current builder state
-