# 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()`
  `static VulkanImageSubresource`
  `of(Iterable<VulkanImageAspectFlag> aspectMask, int mipLevel, int arrayLayer)`
  Construct a new immutable `VulkanImageSubresource` instance.
  `static VulkanImageSubresource`
  `of(Set<VulkanImageAspectFlag> aspectMask, int mipLevel, int arrayLayer)`
  Construct a new immutable `VulkanImageSubresource` instance.
  `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 java.lang.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 of `this` object

  - ### 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 of 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 of 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

  - ### of

    public static VulkanImageSubresource of(Set<VulkanImageAspectFlag> aspectMask, int mipLevel, int arrayLayer)
    Construct a new immutable `VulkanImageSubresource` instance.
    Parameters:
      `aspectMask` - The value for the `aspectMask` attribute
      `mipLevel` - The value for the `mipLevel` attribute
      `arrayLayer` - The value for the `arrayLayer` attribute
    Returns:
      An immutable VulkanImageSubresource instance

  - ### of

    public static VulkanImageSubresource of(Iterable<VulkanImageAspectFlag> aspectMask, int mipLevel, int arrayLayer)
    Construct a new immutable `VulkanImageSubresource` instance.
    Parameters:
      `aspectMask` - The value for the `aspectMask` attribute
      `mipLevel` - The value for the `mipLevel` attribute
      `arrayLayer` - The value for the `arrayLayer` attribute
    Returns:
      An immutable VulkanImageSubresource instance

  - ### 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) // required mipLevel
            .setArrayLayer(int) // required arrayLayer
            .build();

    Returns:
      A new VulkanImageSubresource builder