# Class VulkanAttachmentDescription

java.lang.Object
com.io7m.jcoronado.api.VulkanAttachmentDescription

All Implemented Interfaces:
  `VulkanAttachmentDescriptionType`

public final class VulkanAttachmentDescription extends Object implements VulkanAttachmentDescriptionType
Structure specifying an attachment description

See Also:
  - "VkAttachmentDescription"

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `VulkanAttachmentDescription.Builder`
  Builds instances of type `VulkanAttachmentDescription`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VulkanAttachmentDescription.Builder`
  `builder()`
  Creates a builder for `VulkanAttachmentDescription`.
  `static VulkanAttachmentDescription`
  `copyOf(VulkanAttachmentDescriptionType instance)`
  Creates an immutable copy of a `VulkanAttachmentDescriptionType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanAttachmentDescription` that have equal attribute values.
  `VulkanImageLayout`
  `finalLayout()`
  `Set<VulkanAttachmentDescriptionFlag>`
  `flags()`
  `VulkanFormat`
  `format()`
  `int`
  `hashCode()`
  Computes a hash code from attributes: `flags`, `format`, `samples`, `loadOp`, `storeOp`, `stencilLoadOp`, `stencilStoreOp`, `initialLayout`, `finalLayout`.
  `VulkanImageLayout`
  `initialLayout()`
  `VulkanAttachmentLoadOp`
  `loadOp()`
  `VulkanSampleCountFlag`
  `samples()`
  `VulkanAttachmentLoadOp`
  `stencilLoadOp()`
  `VulkanAttachmentStoreOp`
  `stencilStoreOp()`
  `VulkanAttachmentStoreOp`
  `storeOp()`
  `String`
  `toString()`
  Prints the immutable value `VulkanAttachmentDescription` with attribute values.
  `final VulkanAttachmentDescription`
  `withFinalLayout(VulkanImageLayout value)`
  Copy the current immutable object by setting a value for the `finalLayout` attribute.
  `final VulkanAttachmentDescription`
  `withFlags(VulkanAttachmentDescriptionFlag... elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VulkanAttachmentDescription`
  `withFlags(Iterable<VulkanAttachmentDescriptionFlag> elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VulkanAttachmentDescription`
  `withFormat(VulkanFormat value)`
  Copy the current immutable object by setting a value for the `format` attribute.
  `final VulkanAttachmentDescription`
  `withInitialLayout(VulkanImageLayout value)`
  Copy the current immutable object by setting a value for the `initialLayout` attribute.
  `final VulkanAttachmentDescription`
  `withLoadOp(VulkanAttachmentLoadOp value)`
  Copy the current immutable object by setting a value for the `loadOp` attribute.
  `final VulkanAttachmentDescription`
  `withSamples(VulkanSampleCountFlag value)`
  Copy the current immutable object by setting a value for the `samples` attribute.
  `final VulkanAttachmentDescription`
  `withStencilLoadOp(VulkanAttachmentLoadOp value)`
  Copy the current immutable object by setting a value for the `stencilLoadOp` attribute.
  `final VulkanAttachmentDescription`
  `withStencilStoreOp(VulkanAttachmentStoreOp value)`
  Copy the current immutable object by setting a value for the `stencilStoreOp` attribute.
  `final VulkanAttachmentDescription`
  `withStoreOp(VulkanAttachmentStoreOp value)`
  Copy the current immutable object by setting a value for the `storeOp` attribute.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### flags

    public Set<VulkanAttachmentDescriptionFlag> flags()
    Specified by:
      `flags` in interface `VulkanAttachmentDescriptionType`
    Returns:
      flags specifying additional properties of the attachment.

  - ### format

    public VulkanFormat format()
    Specified by:
      `format` in interface `VulkanAttachmentDescriptionType`
    Returns:
      the format of the image view that will be used for the attachment.

  - ### samples

    public VulkanSampleCountFlag samples()
    Specified by:
      `samples` in interface `VulkanAttachmentDescriptionType`
    Returns:
      the number of samples of the image.

  - ### loadOp

    public VulkanAttachmentLoadOp loadOp()
    Specified by:
      `loadOp` in interface `VulkanAttachmentDescriptionType`
    Returns:
      A value specifying how the contents of color and depth components of the attachment are treated at the beginning of the subpass where it is first used.

  - ### storeOp

    public VulkanAttachmentStoreOp storeOp()
    Specified by:
      `storeOp` in interface `VulkanAttachmentDescriptionType`
    Returns:
      A value specifying how the contents of color and depth components of the attachment are treated at the end of the subpass where it is last used.

  - ### stencilLoadOp

    public VulkanAttachmentLoadOp stencilLoadOp()
    Specified by:
      `stencilLoadOp` in interface `VulkanAttachmentDescriptionType`
    Returns:
      A value specifying how the contents of stencil components of the attachment are treated at the beginning of the subpass where it is first used.

  - ### stencilStoreOp

    public VulkanAttachmentStoreOp stencilStoreOp()
    Specified by:
      `stencilStoreOp` in interface `VulkanAttachmentDescriptionType`
    Returns:
      A value specifying how the contents of stencil components of the attachment are treated at the end of the last subpass where it is used.

  - ### initialLayout

    public VulkanImageLayout initialLayout()
    Specified by:
      `initialLayout` in interface `VulkanAttachmentDescriptionType`
    Returns:
      The layout the attachment image subresource will be in when a render pass instance begins.

  - ### finalLayout

    public VulkanImageLayout finalLayout()
    Specified by:
      `finalLayout` in interface `VulkanAttachmentDescriptionType`
    Returns:
      The layout the attachment image subresource will be transitioned to when a render pass instance ends. During a render pass instance, an attachment can use a different layout in each subpass, if desired.

  - ### withFlags

    public final VulkanAttachmentDescription withFlags(VulkanAttachmentDescriptionFlag... elements)
    Copy the current immutable object with elements that replace the content of `flags`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withFlags

    public final VulkanAttachmentDescription withFlags(Iterable<VulkanAttachmentDescriptionFlag> elements)
    Copy the current immutable object with elements that replace the content of `flags`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of flags elements to set
    Returns:
      A modified copy or `this` if not changed

  - ### withFormat

    public final VulkanAttachmentDescription withFormat(VulkanFormat value)
    Copy the current immutable object by setting a value for the `format` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for format
    Returns:
      A modified copy or the `this` object

  - ### withSamples

    public final VulkanAttachmentDescription withSamples(VulkanSampleCountFlag value)
    Copy the current immutable object by setting a value for the `samples` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for samples
    Returns:
      A modified copy or the `this` object

  - ### withLoadOp

    public final VulkanAttachmentDescription withLoadOp(VulkanAttachmentLoadOp value)
    Copy the current immutable object by setting a value for the `loadOp` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for loadOp
    Returns:
      A modified copy or the `this` object

  - ### withStoreOp

    public final VulkanAttachmentDescription withStoreOp(VulkanAttachmentStoreOp value)
    Copy the current immutable object by setting a value for the `storeOp` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for storeOp
    Returns:
      A modified copy or the `this` object

  - ### withStencilLoadOp

    public final VulkanAttachmentDescription withStencilLoadOp(VulkanAttachmentLoadOp value)
    Copy the current immutable object by setting a value for the `stencilLoadOp` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for stencilLoadOp
    Returns:
      A modified copy or the `this` object

  - ### withStencilStoreOp

    public final VulkanAttachmentDescription withStencilStoreOp(VulkanAttachmentStoreOp value)
    Copy the current immutable object by setting a value for the `stencilStoreOp` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for stencilStoreOp
    Returns:
      A modified copy or the `this` object

  - ### withInitialLayout

    public final VulkanAttachmentDescription withInitialLayout(VulkanImageLayout value)
    Copy the current immutable object by setting a value for the `initialLayout` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for initialLayout
    Returns:
      A modified copy or the `this` object

  - ### withFinalLayout

    public final VulkanAttachmentDescription withFinalLayout(VulkanImageLayout value)
    Copy the current immutable object by setting a value for the `finalLayout` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for finalLayout
    Returns:
      A modified copy or the `this` object

  - ### equals

    public boolean equals(Object another)
    This instance is equal to all instances of `VulkanAttachmentDescription` that have equal attribute values.
    Overrides:
      `equals` in class `Object`
    Returns:
      `true` if `this` is equal to `another` instance

  - ### hashCode

    public int hashCode()
    Computes a hash code from attributes: `flags`, `format`, `samples`, `loadOp`, `storeOp`, `stencilLoadOp`, `stencilStoreOp`, `initialLayout`, `finalLayout`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

    public String toString()
    Prints the immutable value `VulkanAttachmentDescription` with attribute values.
    Overrides:
      `toString` in class `Object`
    Returns:
      A string representation of the value

  - ### copyOf

    public static VulkanAttachmentDescription copyOf(VulkanAttachmentDescriptionType instance)
    Creates an immutable copy of a `VulkanAttachmentDescriptionType` value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
    Parameters:
      `instance` - The instance to copy
    Returns:
      A copied immutable VulkanAttachmentDescription instance

  - ### builder

    public static VulkanAttachmentDescription.Builder builder()
    Creates a builder for `VulkanAttachmentDescription`.

        VulkanAttachmentDescription.builder()
           .addFlags|addAllFlags(com.io7m.jcoronado.api.VulkanAttachmentDescriptionFlag) // flags elements
           .setFormat(com.io7m.jcoronado.api.VulkanFormat) // optional format
           .setSamples(com.io7m.jcoronado.api.VulkanSampleCountFlag) // optional samples
           .setLoadOp(com.io7m.jcoronado.api.VulkanAttachmentLoadOp) // optional loadOp
           .setStoreOp(com.io7m.jcoronado.api.VulkanAttachmentStoreOp) // optional storeOp
           .setStencilLoadOp(com.io7m.jcoronado.api.VulkanAttachmentLoadOp) // optional stencilLoadOp
           .setStencilStoreOp(com.io7m.jcoronado.api.VulkanAttachmentStoreOp) // optional stencilStoreOp
           .setInitialLayout(com.io7m.jcoronado.api.VulkanImageLayout) // optional initialLayout
           .setFinalLayout(com.io7m.jcoronado.api.VulkanImageLayout) // optional finalLayout
           .build();

    Returns:
      A new VulkanAttachmentDescription builder