Record Class AdocLibrary

java.lang.Object
java.lang.Record
network.ike.plugin.adoc.AdocLibrary
Record Components:
coordinates - the library's coordinates
zip - the resolved adoc zip, or null for a reactor member
sourceRoot - the reactor member's src/docs/asciidoc, or null for a zip

public record AdocLibrary(AdocCoordinates coordinates, Path zip, Path sourceRoot) extends Record
One library to put in the union: either an external zip resolved from a repository, or a module of the same reactor whose AsciiDoc source root is on this machine. Exactly one of zip() and sourceRoot() is set.
  • Constructor Details

    • AdocLibrary

      public AdocLibrary(AdocCoordinates coordinates, Path zip, Path sourceRoot)
      Checks that the coordinates are present and that exactly one source is set.
      Parameters:
      coordinates - the coordinates
      zip - the zip, or null
      sourceRoot - the source root, or null
  • Method Details

    • external

      public static AdocLibrary external(AdocCoordinates coordinates, Path zip)
      A library resolved as a zip from a repository.
      Parameters:
      coordinates - the coordinates
      zip - the zip file
      Returns:
      the library
    • reactor

      public static AdocLibrary reactor(AdocCoordinates coordinates, Path sourceRoot)
      A library that is a module of the same reactor.
      Parameters:
      coordinates - the coordinates
      sourceRoot - the module's AsciiDoc source root, src/docs/asciidoc
      Returns:
      the library
    • isReactor

      public boolean isReactor()
      Whether this library is a module of the same reactor.
      Returns:
      true for a reactor member, false for a zip
    • 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.
    • coordinates

      public AdocCoordinates coordinates()
      Returns the value of the coordinates record component.
      Returns:
      the value of the coordinates record component
    • zip

      public Path zip()
      Returns the value of the zip record component.
      Returns:
      the value of the zip record component
    • sourceRoot

      public Path sourceRoot()
      Returns the value of the sourceRoot record component.
      Returns:
      the value of the sourceRoot record component