# Record Class CAItem

java.lang.Object
java.lang.Record
com.io7m.cardant.model.CAItem

Record Components:
  `id` - The item ID
  `name` - The item name
  `timeCreated` - The time the item was created
  `timeUpdated` - The time the item was last updated
  `metadata` - The item metadata
  `attachments` - The item attachments
  `types` - 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

  Constructors
  Constructor
  Description
  `CAItem(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 Type
  Method
  Description
  `SortedMap<CAAttachmentKey,CAAttachment>`
  `attachments()`
  Returns the value of the `attachments` record component.
  `static CAItem`
  `create()`
  Create an empty item with a pseudorandom ID.
  `static CAItem`
  `createWith(CAItemID id)`
  Create an empty item with the given ID.
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `CAItemID`
  `id()`
  Returns the value of the `id` record component.
  `SortedMap<CATypeRecordFieldIdentifier,CAMetadataType>`
  `metadata()`
  Returns the value of the `metadata` record component.
  `String`
  `name()`
  Returns the value of the `name` record component.
  `CAItemSummary`
  `summary()`
  `OffsetDateTime`
  `timeCreated()`
  Returns the value of the `timeCreated` record component.
  `OffsetDateTime`
  `timeUpdated()`
  Returns the value of the `timeUpdated` record component.
  `final String`
  `toString()`
  Returns a string representation of this record class.
  `SortedSet<CATypeRecordIdentifier>`
  `types()`
  Returns the value of the `types` record component.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods 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 ID
      `name` - The item name
      `timeCreated` - The time the item was created
      `timeUpdated` - The time the item was last updated
      `metadata` - The item metadata
      `attachments` - The item attachments
      `types` - The item types

- ## Method Details

  - ### create

    public static CAItem create()
    Create an empty item with a pseudorandom ID.
    Returns:
      The item

  - ### createWith

    public static CAItem createWith(CAItemID id)
    Create an empty item with the given ID.
    Parameters:
      `id` - The ID
    Returns:
      The item

  - ### summary

    public CAItemSummary summary()
    Specified by:
      `summary` in interface `CAInventoryObjectType<CAItemSummary>`
    Returns:
      A summary of the object

  - ### 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.

  - ### id

    public CAItemID id()
    Returns the value of the `id` record component.
    Returns:
      the value of the `id` record component

  - ### name

    public String name()
    Returns the value of the `name` record component.
    Returns:
      the value of the `name` record component

  - ### timeCreated

    public OffsetDateTime timeCreated()
    Returns the value of the `timeCreated` record component.
    Returns:
      the value of the `timeCreated` record component

  - ### timeUpdated

    public OffsetDateTime timeUpdated()
    Returns the value of the `timeUpdated` record component.
    Returns:
      the value of the `timeUpdated` record component

  - ### metadata

    public SortedMap<CATypeRecordFieldIdentifier,CAMetadataType> metadata()
    Returns the value of the `metadata` record component.
    Specified by:
      `metadata` in interface `CAInventoryObjectType<CAItemSummary>`
    Returns:
      the value of the `metadata` record component

  - ### attachments

    public SortedMap<CAAttachmentKey,CAAttachment> attachments()
    Returns the value of the `attachments` record component.
    Specified by:
      `attachments` in interface `CAInventoryObjectType<CAItemSummary>`
    Returns:
      the value of the `attachments` record component

  - ### types

    public SortedSet<CATypeRecordIdentifier> types()
    Returns the value of the `types` record component.
    Specified by:
      `types` in interface `CAInventoryObjectType<CAItemSummary>`
    Returns:
      the value of the `types` record component