Record Class LockfileEntry
java.lang.Object
java.lang.Record
network.ike.plugin.scaffold.LockfileEntry
- Record Components:
tier- the ownership tier for this file; nevernulltemplateSha- hash of the template last applied; may benullforScaffoldTier.MODEL_MANAGEDappliedSha- hash of the file on disk at last publish; may benullforScaffoldTier.TOOL_OWNEDandScaffoldTier.MODEL_MANAGEDmanagedElements- per-element provenance forScaffoldTier.MODEL_MANAGED; nevernull(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: onlytemplateShais populated (appliedShais the same as templateSha by policy — we always overwrite — andmanagedElementsis empty).TRACKED/TRACKED_BLOCK: bothtemplateSha(last template applied) andappliedSha(whole-file hash the last publish produced on disk) are populated;managedElementsis empty.MODEL_MANAGED:templateShaandappliedShaare null;managedElementslists per-element provenance.
Hash values are stored in the form
"sha256:" + hex-digest so future hash algorithms can be
added without ambiguity.
-
Constructor Summary
ConstructorsConstructorDescriptionLockfileEntry(ScaffoldTier tier, String templateSha, String appliedSha, List<ManagedElement> managedElements) Canonical constructor with validation and defensive copying. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theappliedSharecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themanagedElementsrecord component.static LockfileEntrymodelManaged(List<ManagedElement> elements) Convenience factory for a model-managed entry.Returns the value of thetemplateSharecord component.tier()Returns the value of thetierrecord component.static LockfileEntryConvenience factory for a tool-owned entry (only templateSha matters; divergence is reported but never blocks publish).final StringtoString()Returns a string representation of this record class.static LockfileEntrytracked(ScaffoldTier tier, String templateSha, String appliedSha) Convenience factory for a tracked or tracked-block entry.
-
Constructor Details
-
LockfileEntry
public LockfileEntry(ScaffoldTier tier, String templateSha, String appliedSha, List<ManagedElement> managedElements) Canonical constructor with validation and defensive copying.
-
-
Method Details
-
toolOwned
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
Convenience factory for a tracked or tracked-block entry.- Parameters:
tier- one ofScaffoldTier.TRACKEDorScaffoldTier.TRACKED_BLOCKtemplateSha- hash of the template last appliedappliedSha- hash of the file on disk after last publish- Returns:
- the entry
-
modelManaged
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
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
tier
-
templateSha
Returns the value of thetemplateSharecord component.- Returns:
- the value of the
templateSharecord component
-
appliedSha
Returns the value of theappliedSharecord component.- Returns:
- the value of the
appliedSharecord component
-
managedElements
Returns the value of themanagedElementsrecord component.- Returns:
- the value of the
managedElementsrecord component
-