# Class VulkanBufferCreateInfo

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

All Implemented Interfaces:
  `VulkanBufferCreateInfoType`

public final class VulkanBufferCreateInfo extends Object implements VulkanBufferCreateInfoType
Information required to create a buffer.

See Also:
  - "VkBufferCreateInfo"

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VulkanBufferCreateInfo.Builder`
  `builder()`
  Creates a builder for `VulkanBufferCreateInfo`.
  `static VulkanBufferCreateInfo`
  `copyOf(VulkanBufferCreateInfoType instance)`
  Creates an immutable copy of a `VulkanBufferCreateInfoType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanBufferCreateInfo` that have equal attribute values.
  `Set<VulkanBufferCreateFlag>`
  `flags()`
  `int`
  `hashCode()`
  Computes a hash code from attributes: `flags`, `size`, `usageFlags`, `sharingMode`, `queueFamilyIndices`.
  `List<VulkanQueueFamilyIndex>`
  `queueFamilyIndices()`
  `VulkanSharingMode`
  `sharingMode()`
  `long`
  `size()`
  `String`
  `toString()`
  Prints the immutable value `VulkanBufferCreateInfo` with attribute values.
  `Set<VulkanBufferUsageFlag>`
  `usageFlags()`
  `final VulkanBufferCreateInfo`
  `withFlags(VulkanBufferCreateFlag... elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VulkanBufferCreateInfo`
  `withFlags(Iterable<VulkanBufferCreateFlag> elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VulkanBufferCreateInfo`
  `withQueueFamilyIndices(VulkanQueueFamilyIndex... elements)`
  Copy the current immutable object with elements that replace the content of `queueFamilyIndices`.
  `final VulkanBufferCreateInfo`
  `withQueueFamilyIndices(Iterable<? extends VulkanQueueFamilyIndex> elements)`
  Copy the current immutable object with elements that replace the content of `queueFamilyIndices`.
  `final VulkanBufferCreateInfo`
  `withSharingMode(VulkanSharingMode value)`
  Copy the current immutable object by setting a value for the `sharingMode` attribute.
  `final VulkanBufferCreateInfo`
  `withSize(long value)`
  Copy the current immutable object by setting a value for the `size` attribute.
  `final VulkanBufferCreateInfo`
  `withUsageFlags(VulkanBufferUsageFlag... elements)`
  Copy the current immutable object with elements that replace the content of `usageFlags`.
  `final VulkanBufferCreateInfo`
  `withUsageFlags(Iterable<VulkanBufferUsageFlag> elements)`
  Copy the current immutable object with elements that replace the content of `usageFlags`.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### flags

    public Set<VulkanBufferCreateFlag> flags()
    Specified by:
      `flags` in interface `VulkanBufferCreateInfoType`
    Returns:
      A bitmask of VkBufferCreateFlagBits specifying additional parameters of the buffer.

  - ### size

    public long size()
    Specified by:
      `size` in interface `VulkanBufferCreateInfoType`
    Returns:
      The size in bytes of the buffer to be created.

  - ### usageFlags

    public Set<VulkanBufferUsageFlag> usageFlags()
    Specified by:
      `usageFlags` in interface `VulkanBufferCreateInfoType`
    Returns:
      A bitmask of VkBufferUsageFlagBits specifying allowed usages of the buffer.

  - ### sharingMode

    public VulkanSharingMode sharingMode()
    Specified by:
      `sharingMode` in interface `VulkanBufferCreateInfoType`
    Returns:
      A VkSharingMode value specifying the sharing mode of the buffer when it will be accessed by multiple queue families.

  - ### queueFamilyIndices

    public List<VulkanQueueFamilyIndex> queueFamilyIndices()
    Specified by:
      `queueFamilyIndices` in interface `VulkanBufferCreateInfoType`
    Returns:
      A list of queue families that will access this buffer (ignored if sharingMode is not VK_SHARING_MODE_CONCURRENT).

  - ### withFlags

    public final VulkanBufferCreateInfo withFlags(VulkanBufferCreateFlag... elements)
    Copy the current immutable object with elements that replace the content of `flags`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withFlags

    public final VulkanBufferCreateInfo withFlags(Iterable<VulkanBufferCreateFlag> elements)
    Copy the current immutable object with elements that replace the content of `flags`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of flags elements to set
    Returns:
      A modified copy or `this` if not changed

  - ### withSize

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

  - ### withUsageFlags

    public final VulkanBufferCreateInfo withUsageFlags(VulkanBufferUsageFlag... elements)
    Copy the current immutable object with elements that replace the content of `usageFlags`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withUsageFlags

    public final VulkanBufferCreateInfo withUsageFlags(Iterable<VulkanBufferUsageFlag> elements)
    Copy the current immutable object with elements that replace the content of `usageFlags`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of usageFlags elements to set
    Returns:
      A modified copy or `this` if not changed

  - ### withSharingMode

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

  - ### withQueueFamilyIndices

    public final VulkanBufferCreateInfo withQueueFamilyIndices(VulkanQueueFamilyIndex... elements)
    Copy the current immutable object with elements that replace the content of `queueFamilyIndices`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withQueueFamilyIndices

    public final VulkanBufferCreateInfo withQueueFamilyIndices(Iterable<? extends VulkanQueueFamilyIndex> elements)
    Copy the current immutable object with elements that replace the content of `queueFamilyIndices`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `elements` - An iterable of queueFamilyIndices elements to set
    Returns:
      A modified copy or `this` if not changed

  - ### equals

    public boolean equals(Object another)
    This instance is equal to all instances of `VulkanBufferCreateInfo` 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: `flags`, `size`, `usageFlags`, `sharingMode`, `queueFamilyIndices`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

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

  - ### copyOf

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

  - ### builder

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

        VulkanBufferCreateInfo.builder()
           .addFlags|addAllFlags(com.io7m.jcoronado.api.VulkanBufferCreateFlag) // flags elements
           .setSize(long) // optional size
           .addUsageFlags|addAllUsageFlags(com.io7m.jcoronado.api.VulkanBufferUsageFlag) // usageFlags elements
           .setSharingMode(com.io7m.jcoronado.api.VulkanSharingMode) // optional sharingMode
           .addQueueFamilyIndices|addAllQueueFamilyIndices(com.io7m.jcoronado.api.VulkanQueueFamilyIndex) // queueFamilyIndices elements
           .build();

    Returns:
      A new VulkanBufferCreateInfo builder