# 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`.
  `static VulkanBufferCreateInfo`
  `of(Iterable<VulkanBufferCreateFlag> flags, long size, Iterable<VulkanBufferUsageFlag> usageFlags, VulkanSharingMode sharingMode, Iterable<? extends VulkanQueueFamilyIndex> queueFamilyIndices)`
  Construct a new immutable `VulkanBufferCreateInfo` instance.
  `static VulkanBufferCreateInfo`
  `of(Set<VulkanBufferCreateFlag> flags, long size, Set<VulkanBufferUsageFlag> usageFlags, VulkanSharingMode sharingMode, List<VulkanQueueFamilyIndex> queueFamilyIndices)`
  Construct a new immutable `VulkanBufferCreateInfo` instance.
  `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 java.lang.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 of `this` object

  - ### 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 of 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 of `this` object

  - ### 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 of 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 of `this` object

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

  - ### of

    public static VulkanBufferCreateInfo of(Set<VulkanBufferCreateFlag> flags, long size, Set<VulkanBufferUsageFlag> usageFlags, VulkanSharingMode sharingMode, List<VulkanQueueFamilyIndex> queueFamilyIndices)
    Construct a new immutable `VulkanBufferCreateInfo` instance.
    Parameters:
      `flags` - The value for the `flags` attribute
      `size` - The value for the `size` attribute
      `usageFlags` - The value for the `usageFlags` attribute
      `sharingMode` - The value for the `sharingMode` attribute
      `queueFamilyIndices` - The value for the `queueFamilyIndices` attribute
    Returns:
      An immutable VulkanBufferCreateInfo instance

  - ### of

    public static VulkanBufferCreateInfo of(Iterable<VulkanBufferCreateFlag> flags, long size, Iterable<VulkanBufferUsageFlag> usageFlags, VulkanSharingMode sharingMode, Iterable<? extends VulkanQueueFamilyIndex> queueFamilyIndices)
    Construct a new immutable `VulkanBufferCreateInfo` instance.
    Parameters:
      `flags` - The value for the `flags` attribute
      `size` - The value for the `size` attribute
      `usageFlags` - The value for the `usageFlags` attribute
      `sharingMode` - The value for the `sharingMode` attribute
      `queueFamilyIndices` - The value for the `queueFamilyIndices` attribute
    Returns:
      An immutable VulkanBufferCreateInfo instance

  - ### 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) // required size
            .addUsageFlags|addAllUsageFlags(com.io7m.jcoronado.api.VulkanBufferUsageFlag) // usageFlags elements
            .setSharingMode(com.io7m.jcoronado.api.VulkanSharingMode) // required sharingMode
            .addQueueFamilyIndices|addAllQueueFamilyIndices(com.io7m.jcoronado.api.VulkanQueueFamilyIndex) // queueFamilyIndices elements
            .build();

    Returns:
      A new VulkanBufferCreateInfo builder