Record Class TemplateID

java.lang.Object
java.lang.Record
aQute.bnd.wstemplates.TemplateID
All Implemented Interfaces:
Comparable<TemplateID>

public record TemplateID(String organisation, String repository, String path, String ref, String other) extends Record implements Comparable<TemplateID>
The ID of a template. This is either an org/repo/path#ref pattern or a uri to a zip file.
  • Constructor Details

    • TemplateID

      public TemplateID(String organisation, String repository, String path, String ref, String other)
      Creates an instance of a TemplateID record class.
      Parameters:
      organisation - the value for the organisation record component
      repository - the value for the repository record component
      path - the value for the path record component
      ref - the value for the ref record component
      other - the value for the other record component
  • Method Details

    • compareTo

      public int compareTo(TemplateID o)
      Specified by:
      compareTo in interface Comparable<TemplateID>
    • uri

      public URI uri()
      Return the URI.
    • repoUrl

      public String repoUrl()
      Returns:
      the url to the github repo source (without .zip extension)
    • from

      public static TemplateID from(String id)
      Parse the id into a Template ID. The default is `bndtools/bndtools.workspace.min#master`. The missing fields are taken from this default. If the id does not match the pattern, it is assumed to be a URI.
      Parameters:
      id - id or uri
      Returns:
      a TemplateId
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • organisation

      public String organisation()
      Returns the value of the organisation record component.
      Returns:
      the value of the organisation record component
    • repository

      public String repository()
      Returns the value of the repository record component.
      Returns:
      the value of the repository record component
    • path

      public String path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component
    • ref

      public String ref()
      Returns the value of the ref record component.
      Returns:
      the value of the ref record component
    • other

      public String other()
      Returns the value of the other record component.
      Returns:
      the value of the other record component