# Class VulkanImageMemoryBarrier

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

All Implemented Interfaces:
  `VulkanImageMemoryBarrierType`

public final class VulkanImageMemoryBarrier extends Object implements VulkanImageMemoryBarrierType
Structure specifying the parameters of an image memory barrier.

See Also:
  - "VkImageMemoryBarrier"

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VulkanImageMemoryBarrier.Builder`
  `builder()`
  Creates a builder for `VulkanImageMemoryBarrier`.
  `static VulkanImageMemoryBarrier`
  `copyOf(VulkanImageMemoryBarrierType instance)`
  Creates an immutable copy of a `VulkanImageMemoryBarrierType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanImageMemoryBarrier` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `sourceAccessMask`, `targetAccessMask`, `oldLayout`, `newLayout`, `sourceQueueFamilyIndex`, `targetQueueFamilyIndex`, `image`, `subresourceRange`.
  `VulkanImageType`
  `image()`
  `VulkanImageLayout`
  `newLayout()`
  `static VulkanImageMemoryBarrier`
  `of(Iterable<VulkanAccessFlag> sourceAccessMask, Iterable<VulkanAccessFlag> targetAccessMask, VulkanImageLayout oldLayout, VulkanImageLayout newLayout, VulkanQueueFamilyIndex sourceQueueFamilyIndex, VulkanQueueFamilyIndex targetQueueFamilyIndex, VulkanImageType image, VulkanImageSubresourceRange subresourceRange)`
  Construct a new immutable `VulkanImageMemoryBarrier` instance.
  `static VulkanImageMemoryBarrier`
  `of(Set<VulkanAccessFlag> sourceAccessMask, Set<VulkanAccessFlag> targetAccessMask, VulkanImageLayout oldLayout, VulkanImageLayout newLayout, VulkanQueueFamilyIndex sourceQueueFamilyIndex, VulkanQueueFamilyIndex targetQueueFamilyIndex, VulkanImageType image, VulkanImageSubresourceRange subresourceRange)`
  Construct a new immutable `VulkanImageMemoryBarrier` instance.
  `VulkanImageLayout`
  `oldLayout()`
  `Set<VulkanAccessFlag>`
  `sourceAccessMask()`
  `VulkanQueueFamilyIndex`
  `sourceQueueFamilyIndex()`
  `VulkanImageSubresourceRange`
  `subresourceRange()`
  `Set<VulkanAccessFlag>`
  `targetAccessMask()`
  `VulkanQueueFamilyIndex`
  `targetQueueFamilyIndex()`
  `String`
  `toString()`
  Prints the immutable value `VulkanImageMemoryBarrier` with attribute values.
  `final VulkanImageMemoryBarrier`
  `withImage(VulkanImageType value)`
  Copy the current immutable object by setting a value for the `image` attribute.
  `final VulkanImageMemoryBarrier`
  `withNewLayout(VulkanImageLayout value)`
  Copy the current immutable object by setting a value for the `newLayout` attribute.
  `final VulkanImageMemoryBarrier`
  `withOldLayout(VulkanImageLayout value)`
  Copy the current immutable object by setting a value for the `oldLayout` attribute.
  `final VulkanImageMemoryBarrier`
  `withSourceAccessMask(VulkanAccessFlag... elements)`
  Copy the current immutable object with elements that replace the content of `sourceAccessMask`.
  `final VulkanImageMemoryBarrier`
  `withSourceAccessMask(Iterable<VulkanAccessFlag> elements)`
  Copy the current immutable object with elements that replace the content of `sourceAccessMask`.
  `final VulkanImageMemoryBarrier`
  `withSourceQueueFamilyIndex(VulkanQueueFamilyIndex value)`
  Copy the current immutable object by setting a value for the `sourceQueueFamilyIndex` attribute.
  `final VulkanImageMemoryBarrier`
  `withSubresourceRange(VulkanImageSubresourceRange value)`
  Copy the current immutable object by setting a value for the `subresourceRange` attribute.
  `final VulkanImageMemoryBarrier`
  `withTargetAccessMask(VulkanAccessFlag... elements)`
  Copy the current immutable object with elements that replace the content of `targetAccessMask`.
  `final VulkanImageMemoryBarrier`
  `withTargetAccessMask(Iterable<VulkanAccessFlag> elements)`
  Copy the current immutable object with elements that replace the content of `targetAccessMask`.
  `final VulkanImageMemoryBarrier`
  `withTargetQueueFamilyIndex(VulkanQueueFamilyIndex value)`
  Copy the current immutable object by setting a value for the `targetQueueFamilyIndex` attribute.

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

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

- ## Method Details

  - ### sourceAccessMask

    public Set<VulkanAccessFlag> sourceAccessMask()
    Specified by:
      `sourceAccessMask` in interface `VulkanImageMemoryBarrierType`
    Returns:
      The source access mask

  - ### targetAccessMask

    public Set<VulkanAccessFlag> targetAccessMask()
    Specified by:
      `targetAccessMask` in interface `VulkanImageMemoryBarrierType`
    Returns:
      The target access mask

  - ### oldLayout

    public VulkanImageLayout oldLayout()
    Specified by:
      `oldLayout` in interface `VulkanImageMemoryBarrierType`
    Returns:
      The original image layout

  - ### newLayout

    public VulkanImageLayout newLayout()
    Specified by:
      `newLayout` in interface `VulkanImageMemoryBarrierType`
    Returns:
      The target image layout

  - ### sourceQueueFamilyIndex

    public VulkanQueueFamilyIndex sourceQueueFamilyIndex()
    Specified by:
      `sourceQueueFamilyIndex` in interface `VulkanImageMemoryBarrierType`
    Returns:
      The source queue family for a queue family ownership transfer.

  - ### targetQueueFamilyIndex

    public VulkanQueueFamilyIndex targetQueueFamilyIndex()
    Specified by:
      `targetQueueFamilyIndex` in interface `VulkanImageMemoryBarrierType`
    Returns:
      The target queue family for a queue family ownership transfer.

  - ### image

    public VulkanImageType image()
    Specified by:
      `image` in interface `VulkanImageMemoryBarrierType`
    Returns:
      The image affected by this barrier.

  - ### subresourceRange

    public VulkanImageSubresourceRange subresourceRange()
    Specified by:
      `subresourceRange` in interface `VulkanImageMemoryBarrierType`
    Returns:
      The image subresource range within image that is affected by this barrier.

  - ### withSourceAccessMask

    public final VulkanImageMemoryBarrier withSourceAccessMask(VulkanAccessFlag... elements)
    Copy the current immutable object with elements that replace the content of `sourceAccessMask`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withSourceAccessMask

    public final VulkanImageMemoryBarrier withSourceAccessMask(Iterable<VulkanAccessFlag> elements)
    Copy the current immutable object with elements that replace the content of `sourceAccessMask`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of sourceAccessMask elements to set
    Returns:
      A modified copy of `this` object

  - ### withTargetAccessMask

    public final VulkanImageMemoryBarrier withTargetAccessMask(VulkanAccessFlag... elements)
    Copy the current immutable object with elements that replace the content of `targetAccessMask`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withTargetAccessMask

    public final VulkanImageMemoryBarrier withTargetAccessMask(Iterable<VulkanAccessFlag> elements)
    Copy the current immutable object with elements that replace the content of `targetAccessMask`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of targetAccessMask elements to set
    Returns:
      A modified copy of `this` object

  - ### withOldLayout

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

  - ### withNewLayout

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

  - ### withSourceQueueFamilyIndex

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

  - ### withTargetQueueFamilyIndex

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

  - ### withImage

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

  - ### withSubresourceRange

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

  - ### equals

    public boolean equals(Object another)
    This instance is equal to all instances of `VulkanImageMemoryBarrier` 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: `sourceAccessMask`, `targetAccessMask`, `oldLayout`, `newLayout`, `sourceQueueFamilyIndex`, `targetQueueFamilyIndex`, `image`, `subresourceRange`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

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

  - ### of

    public static VulkanImageMemoryBarrier of(Set<VulkanAccessFlag> sourceAccessMask, Set<VulkanAccessFlag> targetAccessMask, VulkanImageLayout oldLayout, VulkanImageLayout newLayout, VulkanQueueFamilyIndex sourceQueueFamilyIndex, VulkanQueueFamilyIndex targetQueueFamilyIndex, VulkanImageType image, VulkanImageSubresourceRange subresourceRange)
    Construct a new immutable `VulkanImageMemoryBarrier` instance.
    Parameters:
      `sourceAccessMask` - The value for the `sourceAccessMask` attribute
      `targetAccessMask` - The value for the `targetAccessMask` attribute
      `oldLayout` - The value for the `oldLayout` attribute
      `newLayout` - The value for the `newLayout` attribute
      `sourceQueueFamilyIndex` - The value for the `sourceQueueFamilyIndex` attribute
      `targetQueueFamilyIndex` - The value for the `targetQueueFamilyIndex` attribute
      `image` - The value for the `image` attribute
      `subresourceRange` - The value for the `subresourceRange` attribute
    Returns:
      An immutable VulkanImageMemoryBarrier instance

  - ### of

    public static VulkanImageMemoryBarrier of(Iterable<VulkanAccessFlag> sourceAccessMask, Iterable<VulkanAccessFlag> targetAccessMask, VulkanImageLayout oldLayout, VulkanImageLayout newLayout, VulkanQueueFamilyIndex sourceQueueFamilyIndex, VulkanQueueFamilyIndex targetQueueFamilyIndex, VulkanImageType image, VulkanImageSubresourceRange subresourceRange)
    Construct a new immutable `VulkanImageMemoryBarrier` instance.
    Parameters:
      `sourceAccessMask` - The value for the `sourceAccessMask` attribute
      `targetAccessMask` - The value for the `targetAccessMask` attribute
      `oldLayout` - The value for the `oldLayout` attribute
      `newLayout` - The value for the `newLayout` attribute
      `sourceQueueFamilyIndex` - The value for the `sourceQueueFamilyIndex` attribute
      `targetQueueFamilyIndex` - The value for the `targetQueueFamilyIndex` attribute
      `image` - The value for the `image` attribute
      `subresourceRange` - The value for the `subresourceRange` attribute
    Returns:
      An immutable VulkanImageMemoryBarrier instance

  - ### copyOf

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

  - ### builder

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

         VulkanImageMemoryBarrier.builder()
            .addSourceAccessMask|addAllSourceAccessMask(com.io7m.jcoronado.api.VulkanAccessFlag) // sourceAccessMask elements
            .addTargetAccessMask|addAllTargetAccessMask(com.io7m.jcoronado.api.VulkanAccessFlag) // targetAccessMask elements
            .setOldLayout(com.io7m.jcoronado.api.VulkanImageLayout) // required oldLayout
            .setNewLayout(com.io7m.jcoronado.api.VulkanImageLayout) // required newLayout
            .setSourceQueueFamilyIndex(com.io7m.jcoronado.api.VulkanQueueFamilyIndex) // required sourceQueueFamilyIndex
            .setTargetQueueFamilyIndex(com.io7m.jcoronado.api.VulkanQueueFamilyIndex) // required targetQueueFamilyIndex
            .setImage(com.io7m.jcoronado.api.VulkanImageType) // required image
            .setSubresourceRange(com.io7m.jcoronado.api.VulkanImageSubresourceRange) // required subresourceRange
            .build();

    Returns:
      A new VulkanImageMemoryBarrier builder