Record Class Document
java.lang.Object
java.lang.Record
net.tangly.core.domain.Document
- Record Components:
id- uri is relative to the domain documents root folder. It is unique within the domain.name- human-readable name of the documenttime- time when the document was createdrange- date range of the information contained in the document. If the document is a snapshot of a state, the range is the date of the snapshottext- human-readable AsciiDoc text describing the documentgenerated- flag indicating if the document was generated by the ERP system. A generated document is not editable and is not subject to retention policies. It can be regenerated at any time.- collection of tags associated with the document
- All Implemented Interfaces:
HasDateRange,HasId,HasName,HasTags,HasText
public record Document(@NotNull String id, @NotNull String name, String extension, @NotNull LocalDateTime time, @NotNull DateRange range, String text, boolean generated, @NotNull Collection<Tag> tags)
extends Record
implements HasId, HasName, HasDateRange, HasText, HasTags
Defines a document and its metadata stored in the system as immutable record.
A document is owed by a domain and is part of the domain model.
The domain handles the access rights to the document and the retention policies.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.tangly.core.HasDateRange
HasDateRange.RangeFilter<T extends HasDateRange> -
Field Summary
Fields inherited from interface net.tangly.core.HasDateRange
FROM, TO -
Constructor Summary
ConstructorsConstructorDescriptionDocument(@NotNull String id, @NotNull String name, String extension, @NotNull LocalDateTime time, @NotNull DateRange range, String text, boolean generated, @NotNull Collection<Tag> tags) Creates an instance of aDocumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theextensionrecord component.booleanReturns the value of thegeneratedrecord component.final inthashCode()Returns a hash code value for this object.@NotNull Stringid()Returns the value of theidrecord component.@NotNull Stringname()Returns the value of thenamerecord component.@NotNull DateRangerange()Returns the value of therangerecord component.@NotNull Collection<Tag> tags()Returns the value of thetagsrecord component.text()Returns the value of thetextrecord component.@NotNull LocalDateTimetime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.static voidupdate(@NotNull Provider<Document> provider, @NotNull Document document, @NotNull DomainAudit audit) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.tangly.core.HasDateRange
from, isActive, isActive, toMethods inherited from interface net.tangly.core.HasTags
containsTag, containsTag, findBy, findBy, findByNamespace, rawTags, value, value
-
Constructor Details
-
Document
public Document(@NotNull @NotNull String id, @NotNull @NotNull String name, String extension, @NotNull @NotNull LocalDateTime time, @NotNull @NotNull DateRange range, String text, boolean generated, @NotNull @NotNull Collection<Tag> tags) Creates an instance of aDocumentrecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentextension- the value for theextensionrecord componenttime- the value for thetimerecord componentrange- the value for therangerecord componenttext- the value for thetextrecord componentgenerated- the value for thegeneratedrecord componenttags- the value for thetagsrecord component
-
-
Method Details
-
update
public static void update(@NotNull @NotNull Provider<Document> provider, @NotNull @NotNull Document document, @NotNull @NotNull DomainAudit audit) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
name
-
extension
Returns the value of theextensionrecord component.- Returns:
- the value of the
extensionrecord component
-
time
-
range
Returns the value of therangerecord component.- Specified by:
rangein interfaceHasDateRange- Returns:
- the value of the
rangerecord component
-
text
-
generated
-
tags
-