# Class VulkanExtent2D

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

All Implemented Interfaces:
  `VulkanExtent2DType`

public final class VulkanExtent2D extends Object implements VulkanExtent2DType
Structure specifying a two-dimensional extent.

See Also:
  - "VkExtent2D"

- ## Nested Class Summary

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

- ## Method Summary

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

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

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

- ## Method Details

  - ### width

    public int width()
    Specified by:
      `width` in interface `VulkanExtent2DType`
    Returns:
      The width of the extent

  - ### height

    public int height()
    Specified by:
      `height` in interface `VulkanExtent2DType`
    Returns:
      The height of the extent

  - ### withWidth

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

  - ### withHeight

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

  - ### equals

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

  - ### toString

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

  - ### of

    public static VulkanExtent2D of(int width, int height)
    Construct a new immutable `VulkanExtent2D` instance.
    Parameters:
      `width` - The value for the `width` attribute
      `height` - The value for the `height` attribute
    Returns:
      An immutable VulkanExtent2D instance

  - ### copyOf

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

  - ### builder

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

         VulkanExtent2D.builder()
            .setWidth(int) // required width
            .setHeight(int) // required height
            .build();

    Returns:
      A new VulkanExtent2D builder