# Class VulkanRectangle2D

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

All Implemented Interfaces:
  `VulkanRectangle2DType`

public final class VulkanRectangle2D extends Object implements VulkanRectangle2DType
Structure specifying a two-dimensional subregion.

See Also:
  - "VkRect2D"

- ## Nested Class Summary

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

- ## Field Summary

  ### Fields inherited from interface VulkanRectangle2DType

  `ZERO`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VulkanRectangle2D.Builder`
  `builder()`
  Creates a builder for `VulkanRectangle2D`.
  `static VulkanRectangle2D`
  `copyOf(VulkanRectangle2DType instance)`
  Creates an immutable copy of a `VulkanRectangle2DType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanRectangle2D` that have equal attribute values.
  `VulkanExtent2D`
  `extent()`
  `int`
  `hashCode()`
  Computes a hash code from attributes: `offset`, `extent`.
  `VulkanOffset2D`
  `offset()`
  `String`
  `toString()`
  Prints the immutable value `VulkanRectangle2D` with attribute values.
  `final VulkanRectangle2D`
  `withExtent(VulkanExtent2D value)`
  Copy the current immutable object by setting a value for the `extent` attribute.
  `final VulkanRectangle2D`
  `withOffset(VulkanOffset2D value)`
  Copy the current immutable object by setting a value for the `offset` attribute.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### offset

    public VulkanOffset2D offset()
    Specified by:
      `offset` in interface `VulkanRectangle2DType`
    Returns:
      The offset

  - ### extent

    public VulkanExtent2D extent()
    Specified by:
      `extent` in interface `VulkanRectangle2DType`
    Returns:
      The extent

  - ### withOffset

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

  - ### withExtent

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

  - ### equals

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

  - ### toString

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

  - ### copyOf

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

  - ### builder

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

        VulkanRectangle2D.builder()
           .setOffset(com.io7m.jcoronado.api.VulkanOffset2D) // optional offset
           .setExtent(com.io7m.jcoronado.api.VulkanExtent2D) // optional extent
           .build();

    Returns:
      A new VulkanRectangle2D builder