Record Class LockfileEntry

java.lang.Object
java.lang.Record
network.ike.plugin.scaffold.LockfileEntry
Record Components:
tier - the ownership tier for this file; never null
templateSha - hash of the template last applied; may be null for ScaffoldTier.MODEL_MANAGED
appliedSha - hash of the file on disk at last publish; may be null for ScaffoldTier.TOOL_OWNED and ScaffoldTier.MODEL_MANAGED
managedElements - per-element provenance for ScaffoldTier.MODEL_MANAGED; never null (use empty list for whole-file tiers). The stored list is unmodifiable.

public record LockfileEntry(ScaffoldTier tier, String templateSha, String appliedSha, List<ManagedElement> managedElements) extends Record
One file's entry in a scaffold lockfile.

The shape depends on the tier:

  • TOOL_OWNED: only templateSha is populated (appliedSha is the same as templateSha by policy — we always overwrite — and managedElements is empty).
  • TRACKED / TRACKED_BLOCK: both templateSha (last template applied) and appliedSha (whole-file hash the last publish produced on disk) are populated; managedElements is empty.
  • MODEL_MANAGED: templateSha and appliedSha are null; managedElements lists per-element provenance.

Hash values are stored in the form "sha256:" + hex-digest so future hash algorithms can be added without ambiguity.

  • Constructor Details

  • Method Details

    • toolOwned

      public static LockfileEntry toolOwned(String templateSha)
      Convenience factory for a tool-owned entry (only templateSha matters; divergence is reported but never blocks publish).
      Parameters:
      templateSha - hash of the template last applied
      Returns:
      a TOOL_OWNED entry
    • tracked

      public static LockfileEntry tracked(ScaffoldTier tier, String templateSha, String appliedSha)
      Convenience factory for a tracked or tracked-block entry.
      Parameters:
      tier - one of ScaffoldTier.TRACKED or ScaffoldTier.TRACKED_BLOCK
      templateSha - hash of the template last applied
      appliedSha - hash of the file on disk after last publish
      Returns:
      the entry
    • modelManaged

      public static LockfileEntry modelManaged(List<ManagedElement> elements)
      Convenience factory for a model-managed entry.
      Parameters:
      elements - per-element provenance; may be empty (the file is model-managed but currently no elements are installed)
      Returns:
      the entry
    • 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.
    • tier

      public ScaffoldTier tier()
      Returns the value of the tier record component.
      Returns:
      the value of the tier record component
    • templateSha

      public String templateSha()
      Returns the value of the templateSha record component.
      Returns:
      the value of the templateSha record component
    • appliedSha

      public String appliedSha()
      Returns the value of the appliedSha record component.
      Returns:
      the value of the appliedSha record component
    • managedElements

      public List<ManagedElement> managedElements()
      Returns the value of the managedElements record component.
      Returns:
      the value of the managedElements record component