# Class VulkanImageSubresource

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

All Implemented Interfaces:
  `VulkanImageSubresourceType`

public final class VulkanImageSubresource extends Object implements VulkanImageSubresourceType
Structure specifying an image subresource.

See Also:
  - "VkImageSubresource"

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `arrayLayer()`
  `Set<VulkanImageAspectFlag>`
  `aspectMask()`
  `static VulkanImageSubresource.Builder`
  `builder()`
  Creates a builder for `VulkanImageSubresource`.
  `static VulkanImageSubresource`
  `copyOf(VulkanImageSubresourceType instance)`
  Creates an immutable copy of a `VulkanImageSubresourceType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanImageSubresource` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `aspectMask`, `mipLevel`, `arrayLayer`.
  `int`
  `mipLevel()`
  `String`
  `toString()`
  Prints the immutable value `VulkanImageSubresource` with attribute values.
  `final VulkanImageSubresource`
  `withArrayLayer(int value)`
  Copy the current immutable object by setting a value for the `arrayLayer` attribute.
  `final VulkanImageSubresource`
  `withAspectMask(VulkanImageAspectFlag... elements)`
  Copy the current immutable object with elements that replace the content of `aspectMask`.
  `final VulkanImageSubresource`
  `withAspectMask(Iterable<VulkanImageAspectFlag> elements)`
  Copy the current immutable object with elements that replace the content of `aspectMask`.
  `final VulkanImageSubresource`
  `withMipLevel(int value)`
  Copy the current immutable object by setting a value for the `mipLevel` 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 `VulkanImageSubresourceType`
    Returns:
      A set of flags selecting the image aspect.

  - ### mipLevel

    public int mipLevel()
    Specified by:
      `mipLevel` in interface `VulkanImageSubresourceType`
    Returns:
      The mipmap level.

  - ### arrayLayer

    public int arrayLayer()
    Specified by:
      `arrayLayer` in interface `VulkanImageSubresourceType`
    Returns:
      The array layer.

  - ### withAspectMask

    public final VulkanImageSubresource 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 VulkanImageSubresource 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

  - ### withMipLevel

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

  - ### withArrayLayer

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

  - ### equals

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

  - ### toString

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

  - ### copyOf

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

  - ### builder

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

        VulkanImageSubresource.builder()
           .addAspectMask|addAllAspectMask(com.io7m.jcoronado.api.VulkanImageAspectFlag) // aspectMask elements
           .setMipLevel(int) // optional mipLevel
           .setArrayLayer(int) // optional arrayLayer
           .build();

    Returns:
      A new VulkanImageSubresource builder