Package com.io7m.cardant.model

# Record Class CAFileType.CAFileWithData

java.lang.Object
java.lang.Record
com.io7m.cardant.model.CAFileType.CAFileWithData

Record Components:
  `id` - The ID
  `description` - The description
  `mediaType` - The media type
  `hashAlgorithm` - The hash algorithm
  `hashValue` - The hash value
  `data` - The data

All Implemented Interfaces:
  `CAFileType`, `Comparable<CAFileType>`

Enclosing interface:
  `CAFileType`

public static record CAFileType.CAFileWithData(CAFileID id, String description, String mediaType, String hashAlgorithm, String hashValue, CAByteArray data) extends Record implements CAFileType
A file with data.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface com.io7m.cardant.model.CAFileType

  `CAFileType.CAFileWithData, CAFileType.CAFileWithoutData`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CAFileWithData(CAFileID id, String description, String mediaType, String hashAlgorithm, String hashValue, CAByteArray data)`
  A file with data.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CAByteArray`
  `data()`
  Returns the value of the `data` record component.
  `Optional<CAByteArray>`
  `dataOptional()`
  `String`
  `description()`
  Returns the value of the `description` record component.
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `String`
  `hashAlgorithm()`
  Returns the value of the `hashAlgorithm` record component.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `String`
  `hashValue()`
  Returns the value of the `hashValue` record component.
  `CAFileID`
  `id()`
  Returns the value of the `id` record component.
  `String`
  `mediaType()`
  Returns the value of the `mediaType` record component.
  `long`
  `size()`
  `final String`
  `toString()`
  Returns a string representation of this record class.
  `CAFileType.CAFileWithoutData`
  `withoutData()`

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

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

  ### Methods inherited from interface com.io7m.cardant.model.CAFileType

  `compareTo`

- ## Constructor Details

  - ### CAFileWithData

    public CAFileWithData(CAFileID id, String description, String mediaType, String hashAlgorithm, String hashValue, CAByteArray data)
    A file with data.

- ## Method Details

  - ### size

    public long size()
    Specified by:
      `size` in interface `CAFileType`
    Returns:
      The size in bytes

  - ### dataOptional

    public Optional<CAByteArray> dataOptional()
    Specified by:
      `dataOptional` in interface `CAFileType`
    Returns:
      The data, if any

  - ### withoutData

    public CAFileType.CAFileWithoutData withoutData()
    Specified by:
      `withoutData` in interface `CAFileType`
    Returns:
      The file without data

  - ### 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 CAFileID id()
    Returns the value of the `id` record component.
    Specified by:
      `id` in interface `CAFileType`
    Returns:
      the value of the `id` record component

  - ### description

    public String description()
    Returns the value of the `description` record component.
    Specified by:
      `description` in interface `CAFileType`
    Returns:
      the value of the `description` record component

  - ### mediaType

    public String mediaType()
    Returns the value of the `mediaType` record component.
    Specified by:
      `mediaType` in interface `CAFileType`
    Returns:
      the value of the `mediaType` record component

  - ### hashAlgorithm

    public String hashAlgorithm()
    Returns the value of the `hashAlgorithm` record component.
    Specified by:
      `hashAlgorithm` in interface `CAFileType`
    Returns:
      the value of the `hashAlgorithm` record component

  - ### hashValue

    public String hashValue()
    Returns the value of the `hashValue` record component.
    Specified by:
      `hashValue` in interface `CAFileType`
    Returns:
      the value of the `hashValue` record component

  - ### data

    public CAByteArray data()
    Returns the value of the `data` record component.
    Returns:
      the value of the `data` record component