Record Class AdocPackage

java.lang.Object
java.lang.Record
network.ike.plugin.adoc.AdocPackage
Record Components:
name - the package path relative to the root, with forward slashes
kind - "topics" for topics, "library" for a library's own rendered content such as its preview index and shared images

public record AdocPackage(String name, String kind) extends Record
One package a library ships: a directory under the library's root, named by the owning group as one dotted segment and then the domain, such as network.ike.lab/dev. A library whose group ends in its only domain uses the group directory itself, such as network.ike.kompendium.anf.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The kind of a package that holds a library's own preview index and shared images.
    static final String
    The kind of a package that holds topics.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AdocPackage(String name, String kind)
    Checks that both parts are present.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether a path relative to the root is inside this package.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the kind record component.
    Returns the value of the name record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • KIND_TOPICS

      public static final String KIND_TOPICS
      The kind of a package that holds topics.
      See Also:
    • KIND_LIBRARY

      public static final String KIND_LIBRARY
      The kind of a package that holds a library's own preview index and shared images.
      See Also:
  • Constructor Details

    • AdocPackage

      public AdocPackage(String name, String kind)
      Checks that both parts are present.
      Parameters:
      name - the package path
      kind - the package kind
  • Method Details

    • contains

      public boolean contains(String path)
      Whether a path relative to the root is inside this package.
      Parameters:
      path - a path relative to the root, with forward slashes
      Returns:
      true when the path is under this package's directory
    • 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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • kind

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