Record Class LetterComponent
java.lang.Object
java.lang.Record
com.nsdev.lettergenerator.component.LetterComponent
- Record Components:
blocks- ordered component content, snapshotted while preserving invalid entries
Reusable immutable content registered on an individual document. References expand into ordinary
groups before validation, retaining the group's soft keep unless explicitly overridden.
Components may contain references to other registrations; generation rejects unknown names and
cycles. No filesystem, network access or executable inclusion occurs.
-
Constructor Summary
ConstructorsConstructorDescriptionLetterComponent(List<Block> blocks) Snapshots content without validating it. -
Method Summary
Modifier and TypeMethodDescriptionblocks()Returns the value of theblocksrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static LetterComponentGroups model blocks for document-local registration.static LetterComponentCreates one ordinary paragraph per supplied literal string, suitable for address lines.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LetterComponent
Snapshots content without validating it.- Parameters:
blocks- ordered blocks, or null for generation-time validation
-
-
Method Details
-
of
Groups model blocks for document-local registration.- Parameters:
blocks- ordered reusable blocks- Returns:
- immutable component
-
text
Creates one ordinary paragraph per supplied literal string, suitable for address lines.- Parameters:
paragraphs- ordered literal paragraph text- Returns:
- immutable component without local style overrides
-
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. -
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. -
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). -
blocks
Returns the value of theblocksrecord component.- Returns:
- the value of the
blocksrecord component
-