# Class VulkanClearAttachment

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

All Implemented Interfaces:
  `VulkanClearAttachmentType`

public final class VulkanClearAttachment extends Object implements VulkanClearAttachmentType
Structure specifying a clear attachment.

See Also:
  - "VkClearAttachment"

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Set<VulkanImageAspectFlag>`
  `aspectMask()`
  `static VulkanClearAttachment.Builder`
  `builder()`
  Creates a builder for `VulkanClearAttachment`.
  `VulkanClearValueType`
  `clearValue()`
  `int`
  `colorAttachment()`
  `static VulkanClearAttachment`
  `copyOf(VulkanClearAttachmentType instance)`
  Creates an immutable copy of a `VulkanClearAttachmentType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanClearAttachment` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `aspectMask`, `colorAttachment`, `clearValue`.
  `String`
  `toString()`
  Prints the immutable value `VulkanClearAttachment` with attribute values.
  `final VulkanClearAttachment`
  `withAspectMask(VulkanImageAspectFlag... elements)`
  Copy the current immutable object with elements that replace the content of `aspectMask`.
  `final VulkanClearAttachment`
  `withAspectMask(Iterable<VulkanImageAspectFlag> elements)`
  Copy the current immutable object with elements that replace the content of `aspectMask`.
  `final VulkanClearAttachment`
  `withClearValue(VulkanClearValueType value)`
  Copy the current immutable object by setting a value for the `clearValue` attribute.
  `final VulkanClearAttachment`
  `withColorAttachment(int value)`
  Copy the current immutable object by setting a value for the `colorAttachment` attribute.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### aspectMask

    public Set<VulkanImageAspectFlag> aspectMask()
    Specified by:
      `aspectMask` in interface `VulkanClearAttachmentType`
    Returns:
      A mask selecting the color, depth and/or stencil aspects of the attachment to be cleared.

  - ### colorAttachment

    public int colorAttachment()
    Specified by:
      `colorAttachment` in interface `VulkanClearAttachmentType`
    Returns:
      A value that is only meaningful if VK_IMAGE_ASPECT_COLOR_BIT is set in aspectMask, in which case it is an index to the pColorAttachments array in the VkSubpassDescription structure of the current subpass which selects the color attachment to clear.

  - ### clearValue

    public VulkanClearValueType clearValue()
    Specified by:
      `clearValue` in interface `VulkanClearAttachmentType`
    Returns:
      The color or depth/stencil value to clear the attachment to

  - ### withAspectMask

    public final VulkanClearAttachment withAspectMask(VulkanImageAspectFlag... elements)
    Copy the current immutable object with elements that replace the content of `aspectMask`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withAspectMask

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

  - ### withColorAttachment

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

  - ### withClearValue

    public final VulkanClearAttachment withClearValue(VulkanClearValueType value)
    Copy the current immutable object by setting a value for the `clearValue` attribute. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for clearValue
    Returns:
      A modified copy or the `this` object

  - ### equals

    public boolean equals(Object another)
    This instance is equal to all instances of `VulkanClearAttachment` 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: `aspectMask`, `colorAttachment`, `clearValue`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

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

  - ### copyOf

    public static VulkanClearAttachment copyOf(VulkanClearAttachmentType instance)
    Creates an immutable copy of a `VulkanClearAttachmentType` 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 VulkanClearAttachment instance

  - ### builder

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

        VulkanClearAttachment.builder()
           .addAspectMask|addAllAspectMask(com.io7m.jcoronado.api.VulkanImageAspectFlag) // aspectMask elements
           .setColorAttachment(int) // required colorAttachment
           .setClearValue(com.io7m.jcoronado.api.VulkanClearValueType) // required clearValue
           .build();

    Returns:
      A new VulkanClearAttachment builder