# Class VulkanClearRectangle

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

All Implemented Interfaces:
  `VulkanClearRectangleType`

public final class VulkanClearRectangle extends Object implements VulkanClearRectangleType
Structure specifying a clear rectangle.

See Also:
  - "VkClearRect"

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `baseArrayLayer()`
  `static VulkanClearRectangle.Builder`
  `builder()`
  Creates a builder for `VulkanClearRectangle`.
  `static VulkanClearRectangle`
  `copyOf(VulkanClearRectangleType instance)`
  Creates an immutable copy of a `VulkanClearRectangleType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanClearRectangle` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `rectangle`, `baseArrayLayer`, `layerCount`.
  `int`
  `layerCount()`
  `VulkanRectangle2D`
  `rectangle()`
  `String`
  `toString()`
  Prints the immutable value `VulkanClearRectangle` with attribute values.
  `final VulkanClearRectangle`
  `withBaseArrayLayer(int value)`
  Copy the current immutable object by setting a value for the `baseArrayLayer` attribute.
  `final VulkanClearRectangle`
  `withLayerCount(int value)`
  Copy the current immutable object by setting a value for the `layerCount` attribute.
  `final VulkanClearRectangle`
  `withRectangle(VulkanRectangle2D value)`
  Copy the current immutable object by setting a value for the `rectangle` attribute.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### rectangle

    public VulkanRectangle2D rectangle()
    Specified by:
      `rectangle` in interface `VulkanClearRectangleType`
    Returns:
      The two-dimensional region to be cleared.

  - ### baseArrayLayer

    public int baseArrayLayer()
    Specified by:
      `baseArrayLayer` in interface `VulkanClearRectangleType`
    Returns:
      The first layer to be cleared.

  - ### layerCount

    public int layerCount()
    Specified by:
      `layerCount` in interface `VulkanClearRectangleType`
    Returns:
      The number of layers to clear.

  - ### withRectangle

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

  - ### withBaseArrayLayer

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

  - ### withLayerCount

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

  - ### equals

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

  - ### toString

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

  - ### copyOf

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

  - ### builder

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

        VulkanClearRectangle.builder()
           .setRectangle(com.io7m.jcoronado.api.VulkanRectangle2D) // optional rectangle
           .setBaseArrayLayer(int) // optional baseArrayLayer
           .setLayerCount(int) // optional layerCount
           .build();

    Returns:
      A new VulkanClearRectangle builder