Class Metadata

java.lang.Object
io.jenetics.jpx.Metadata
All Implemented Interfaces:
Serializable

public final class Metadata extends Object implements Serializable
Information about the GPX file, author, and copyright restrictions goes in the metadata section. Providing rich, meaningful information about your GPX files allows others to search for and use your GPS data.

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();
Since:
1.0
Version:
3.0
See Also:
  • Method Details

    • getName

      public Optional<String> getName()
      Return the name of the GPX file.
      Returns:
      the name of the GPX file
    • getDescription

      Return a description of the contents of the GPX file.
      Returns:
      a description of the contents of the GPX file
    • getAuthor

      Return the person or organization who created the GPX file.
      Returns:
      the person or organization who created the GPX file
    • getCopyright

      Return the copyright and license information governing use of the file.
      Returns:
      the copyright and license information governing use of the file
    • getLinks

      public List<Link> getLinks()
      Return the URLs associated with the location described in the file. The returned list immutable.
      Returns:
      the URLs associated with the location described in the file
    • getTime

      Return the creation date of the file.
      Returns:
      the creation date of the file
    • getKeywords

      Return the keywords associated with the file. Search engines or databases can use this information to classify the data.
      Returns:
      the keywords associated with the file
    • getBounds

      Return the minimum and maximum coordinates which describe the extent of the coordinates in the file.
      Returns:
      the minimum and maximum coordinates which describe the extent of the coordinates in the file
    • getExtensions

      Return the (cloned) extensions document. The root element of the returned document has the name extensions.
      <extensions> ... </extensions>
      Returns:
      the extensions document
      Throws:
      DOMException - if the document could not be cloned, because of an erroneous XML configuration
      Since:
      1.5
    • toBuilder

      Convert the immutable metadata object into a mutable builder initialized with the current metadata values.
      Returns:
      a new metadata builder initialized with the values of this metadata
      Since:
      1.1
    • isEmpty

      public boolean isEmpty()
      Return true if all metadata properties are null or empty.
      Returns:
      true if all metadata properties are null or empty
    • nonEmpty

      public boolean nonEmpty()
      Return true if not all metadata properties are null or empty.
      Returns:
      true if not all metadata properties are null or empty
      Since:
      1.1
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • builder

      public static Metadata.Builder builder()
      Return a new Metadata builder.
      Returns:
      a new Metadata builder
    • of

      public static Metadata of(String name, String description, Person author, Copyright copyright, List<Link> links, Instant time, String keywords, Bounds bounds, Document extensions)
      Create a new Metadata object with the given parameters.
      Parameters:
      name - the name of the GPX file
      description - a description of the contents of the GPX file
      author - the person or organization who created the GPX file
      copyright - copyright and license information governing use of the file
      links - URLs associated with the location described in the file
      time - the creation date of the file
      keywords - keywords associated with the file. Search engines or databases can use this information to classify the data.
      bounds - minimum and maximum coordinates which describe the extent of the coordinates in the file
      extensions - the extensions document
      Returns:
      a new Metadata object with the given parameters
      Throws:
      NullPointerException - if the given links sequence is null
      Since:
      1.5
    • of

      public static Metadata of(String name, String description, Person author, Copyright copyright, List<Link> links, Instant time, String keywords, Bounds bounds)
      Create a new Metadata object with the given parameters.
      Parameters:
      name - the name of the GPX file
      description - a description of the contents of the GPX file
      author - the person or organization who created the GPX file
      copyright - copyright and license information governing use of the file
      links - URLs associated with the location described in the file
      time - the creation date of the file
      keywords - keywords associated with the file. Search engines or databases can use this information to classify the data.
      bounds - minimum and maximum coordinates which describe the extent of the coordinates in the file
      Returns:
      a new Metadata object with the given parameters
      Throws:
      NullPointerException - if the given links sequence is null