Record Class CAItem
java.lang.Object
java.lang.Record
com.io7m.cardant.model.CAItem
- Record Components:
id- The item IDname- The item nametimeCreated- The time the item was createdtimeUpdated- The time the item was last updatedmetadata- The item metadataattachments- The item attachmentstypes- The item types
- All Implemented Interfaces:
CAInventoryObjectType<CAItemSummary>
public record CAItem(CAItemID id, String name, OffsetDateTime timeCreated, OffsetDateTime timeUpdated, SortedMap<CATypeRecordFieldIdentifier,CAMetadataType> metadata, SortedMap<CAAttachmentKey,CAAttachment> attachments, SortedSet<CATypeRecordIdentifier> types)
extends Record
implements CAInventoryObjectType<CAItemSummary>
An item in the inventory.
-
Constructor Summary
ConstructorsConstructorDescriptionCAItem(CAItemID id, String name, OffsetDateTime timeCreated, OffsetDateTime timeUpdated, SortedMap<CATypeRecordFieldIdentifier, CAMetadataType> metadata, SortedMap<CAAttachmentKey, CAAttachment> attachments, SortedSet<CATypeRecordIdentifier> types) Construct an item. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattachmentsrecord component.static CAItemcreate()Create an empty item with a pseudorandom ID.static CAItemcreateWith(CAItemID id) Create an empty item with the given ID.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.metadata()Returns the value of themetadatarecord component.name()Returns the value of thenamerecord component.summary()Returns the value of thetimeCreatedrecord component.Returns the value of thetimeUpdatedrecord component.final StringtoString()Returns a string representation of this record class.types()Returns the value of thetypesrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.cardant.model.CAInventoryObjectType
attachmentsWithRelation, firstAttachmentWithRelation, hasAttachmentWithRelation
-
Constructor Details
-
CAItem
public CAItem(CAItemID id, String name, OffsetDateTime timeCreated, OffsetDateTime timeUpdated, SortedMap<CATypeRecordFieldIdentifier, CAMetadataType> metadata, SortedMap<CAAttachmentKey, CAAttachment> attachments, SortedSet<CATypeRecordIdentifier> types) Construct an item.- Parameters:
id- The item IDname- The item nametimeCreated- The time the item was createdtimeUpdated- The time the item was last updatedmetadata- The item metadataattachments- The item attachmentstypes- The item types
-
-
Method Details
-
create
-
createWith
-
summary
- Specified by:
summaryin interfaceCAInventoryObjectType<CAItemSummary>- Returns:
- A summary of the object
-
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). -
id
-
name
-
timeCreated
Returns the value of thetimeCreatedrecord component.- Returns:
- the value of the
timeCreatedrecord component
-
timeUpdated
Returns the value of thetimeUpdatedrecord component.- Returns:
- the value of the
timeUpdatedrecord component
-
metadata
Returns the value of themetadatarecord component.- Specified by:
metadatain interfaceCAInventoryObjectType<CAItemSummary>- Returns:
- the value of the
metadatarecord component
-
attachments
Returns the value of theattachmentsrecord component.- Specified by:
attachmentsin interfaceCAInventoryObjectType<CAItemSummary>- Returns:
- the value of the
attachmentsrecord component
-
types
Returns the value of thetypesrecord component.- Specified by:
typesin interfaceCAInventoryObjectType<CAItemSummary>- Returns:
- the value of the
typesrecord component
-