# Class VulkanDescriptorSetLayoutBinding

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

All Implemented Interfaces:
  `VulkanDescriptorSetLayoutBindingType`

public final class VulkanDescriptorSetLayoutBinding extends Object implements VulkanDescriptorSetLayoutBindingType
Structure specifying a descriptor set layout binding.

See Also:
  - "VkDescriptorSetLayoutBinding"

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `binding()`
  `static VulkanDescriptorSetLayoutBinding.Builder`
  `builder()`
  Creates a builder for `VulkanDescriptorSetLayoutBinding`.
  `static VulkanDescriptorSetLayoutBinding`
  `copyOf(VulkanDescriptorSetLayoutBindingType instance)`
  Creates an immutable copy of a `VulkanDescriptorSetLayoutBindingType` value.
  `int`
  `descriptorCount()`
  `VulkanDescriptorType`
  `descriptorType()`
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanDescriptorSetLayoutBinding` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `binding`, `descriptorType`, `descriptorCount`, `stageFlags`, `immutableSamplers`.
  `List<VulkanSamplerType>`
  `immutableSamplers()`
  `static VulkanDescriptorSetLayoutBinding`
  `of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, Iterable<VulkanShaderStageFlag> stageFlags, Iterable<? extends VulkanSamplerType> immutableSamplers)`
  Construct a new immutable `VulkanDescriptorSetLayoutBinding` instance.
  `static VulkanDescriptorSetLayoutBinding`
  `of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, Set<VulkanShaderStageFlag> stageFlags, List<VulkanSamplerType> immutableSamplers)`
  Construct a new immutable `VulkanDescriptorSetLayoutBinding` instance.
  `Set<VulkanShaderStageFlag>`
  `stageFlags()`
  `String`
  `toString()`
  Prints the immutable value `VulkanDescriptorSetLayoutBinding` with attribute values.
  `final VulkanDescriptorSetLayoutBinding`
  `withBinding(int value)`
  Copy the current immutable object by setting a value for the `binding` attribute.
  `final VulkanDescriptorSetLayoutBinding`
  `withDescriptorCount(int value)`
  Copy the current immutable object by setting a value for the `descriptorCount` attribute.
  `final VulkanDescriptorSetLayoutBinding`
  `withDescriptorType(VulkanDescriptorType value)`
  Copy the current immutable object by setting a value for the `descriptorType` attribute.
  `final VulkanDescriptorSetLayoutBinding`
  `withImmutableSamplers(VulkanSamplerType... elements)`
  Copy the current immutable object with elements that replace the content of `immutableSamplers`.
  `final VulkanDescriptorSetLayoutBinding`
  `withImmutableSamplers(Iterable<? extends VulkanSamplerType> elements)`
  Copy the current immutable object with elements that replace the content of `immutableSamplers`.
  `final VulkanDescriptorSetLayoutBinding`
  `withStageFlags(VulkanShaderStageFlag... elements)`
  Copy the current immutable object with elements that replace the content of `stageFlags`.
  `final VulkanDescriptorSetLayoutBinding`
  `withStageFlags(Iterable<VulkanShaderStageFlag> elements)`
  Copy the current immutable object with elements that replace the content of `stageFlags`.

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

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

- ## Method Details

  - ### binding

    public int binding()
    Specified by:
      `binding` in interface `VulkanDescriptorSetLayoutBindingType`
    Returns:
      The binding number of this entry and corresponds to a resource of the same binding number in the shader stages

  - ### descriptorType

    public VulkanDescriptorType descriptorType()
    Specified by:
      `descriptorType` in interface `VulkanDescriptorSetLayoutBindingType`
    Returns:
      A VulkanDescriptorType specifying which type of resource descriptors are used for this binding.

  - ### descriptorCount

    public int descriptorCount()
    Specified by:
      `descriptorCount` in interface `VulkanDescriptorSetLayoutBindingType`
    Returns:
      The number of descriptors contained in the binding, accessed in a shader as an array , except if descriptorType is VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT in which case descriptorCount is the size in bytes of the inline uniform block . If descriptorCount is zero this binding entry is reserved and the resource must not be accessed from any stage via this binding within any pipeline using the set layout.

  - ### stageFlags

    public Set<VulkanShaderStageFlag> stageFlags()
    Specified by:
      `stageFlags` in interface `VulkanDescriptorSetLayoutBindingType`
    Returns:
      A set of VulkanShaderStageFlag values specifying which pipeline shader stages can access a resource for this binding. VK_SHADER_STAGE_ALL is a shorthand specifying that all defined shader stages, including any additional stages defined by extensions, can access the resource.

  - ### immutableSamplers

    public List<VulkanSamplerType> immutableSamplers()
    Specified by:
      `immutableSamplers` in interface `VulkanDescriptorSetLayoutBindingType`
    Returns:
      A set of samplers to be initialized

  - ### withBinding

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

  - ### withDescriptorType

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

  - ### withDescriptorCount

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

  - ### withStageFlags

    public final VulkanDescriptorSetLayoutBinding withStageFlags(VulkanShaderStageFlag... elements)
    Copy the current immutable object with elements that replace the content of `stageFlags`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withStageFlags

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

  - ### withImmutableSamplers

    public final VulkanDescriptorSetLayoutBinding withImmutableSamplers(VulkanSamplerType... elements)
    Copy the current immutable object with elements that replace the content of `immutableSamplers`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withImmutableSamplers

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

  - ### equals

    public boolean equals(Object another)
    This instance is equal to all instances of `VulkanDescriptorSetLayoutBinding` 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: `binding`, `descriptorType`, `descriptorCount`, `stageFlags`, `immutableSamplers`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

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

  - ### of

    public static VulkanDescriptorSetLayoutBinding of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, Set<VulkanShaderStageFlag> stageFlags, List<VulkanSamplerType> immutableSamplers)
    Construct a new immutable `VulkanDescriptorSetLayoutBinding` instance.
    Parameters:
      `binding` - The value for the `binding` attribute
      `descriptorType` - The value for the `descriptorType` attribute
      `descriptorCount` - The value for the `descriptorCount` attribute
      `stageFlags` - The value for the `stageFlags` attribute
      `immutableSamplers` - The value for the `immutableSamplers` attribute
    Returns:
      An immutable VulkanDescriptorSetLayoutBinding instance

  - ### of

    public static VulkanDescriptorSetLayoutBinding of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, Iterable<VulkanShaderStageFlag> stageFlags, Iterable<? extends VulkanSamplerType> immutableSamplers)
    Construct a new immutable `VulkanDescriptorSetLayoutBinding` instance.
    Parameters:
      `binding` - The value for the `binding` attribute
      `descriptorType` - The value for the `descriptorType` attribute
      `descriptorCount` - The value for the `descriptorCount` attribute
      `stageFlags` - The value for the `stageFlags` attribute
      `immutableSamplers` - The value for the `immutableSamplers` attribute
    Returns:
      An immutable VulkanDescriptorSetLayoutBinding instance

  - ### copyOf

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

  - ### builder

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

         VulkanDescriptorSetLayoutBinding.builder()
            .setBinding(int) // required binding
            .setDescriptorType(com.io7m.jcoronado.api.VulkanDescriptorType) // required descriptorType
            .setDescriptorCount(int) // required descriptorCount
            .addStageFlags|addAllStageFlags(com.io7m.jcoronado.api.VulkanShaderStageFlag) // stageFlags elements
            .addImmutableSamplers|addAllImmutableSamplers(com.io7m.jcoronado.api.VulkanSamplerType) // immutableSamplers elements
            .build();

    Returns:
      A new VulkanDescriptorSetLayoutBinding builder