Record Class LayerSpec

java.lang.Object
java.lang.Record
org.tentackle.common.LayerSpec
Record Components:
name - the layer name, unique within a LayerGraphSpec
parentNames - the names of the parent layers, empty if parented on the boot layer
directories - the module-path directories (or exploded module directories) building this layer

public record LayerSpec(String name, List<String> parentNames, List<Path> directories) extends Record
The declarative description of one named ModuleLayer.

A layer is defined by the module-path directories it is built from and the names of the layers it is parented on. An empty parentNames() means the layer is parented directly on the boot layer.

Author:
harald
  • Constructor Details

    • LayerSpec

      public LayerSpec(String name, List<String> parentNames, List<Path> directories)
      Creates a layer spec.
      Parameters:
      name - the layer name
      parentNames - the names of the parent layers
      directories - the module-path directories
      Throws:
      NullPointerException - if any argument is null
      TentackleRuntimeException - if the name is blank or there are no directories
  • Method Details

    • 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
    • parentNames

      public List<String> parentNames()
      Returns the value of the parentNames record component.
      Returns:
      the value of the parentNames record component
    • directories

      public List<Path> directories()
      Returns the value of the directories record component.
      Returns:
      the value of the directories record component