# Class VMAAllocationCreateInfo

java.lang.Object
com.io7m.jcoronado.vma.VMAAllocationCreateInfo

All Implemented Interfaces:
  `VMAAllocationCreateInfoType`

public final class VMAAllocationCreateInfo extends Object implements VMAAllocationCreateInfoType
Information required to create an allocation.

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VMAAllocationCreateInfo.Builder`
  `builder()`
  Creates a builder for `VMAAllocationCreateInfo`.
  `static VMAAllocationCreateInfo`
  `copyOf(VMAAllocationCreateInfoType instance)`
  Creates an immutable copy of a `VMAAllocationCreateInfoType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VMAAllocationCreateInfo` that have equal attribute values.
  `Set<VMAAllocationCreateFlag>`
  `flags()`
  `int`
  `hashCode()`
  Computes a hash code from attributes: `flags`, `usage`, `requiredFlags`, `preferredFlags`, `memoryTypeBits`.
  `long`
  `memoryTypeBits()`
  `Set<VulkanMemoryPropertyFlag>`
  `preferredFlags()`
  `Set<VulkanMemoryPropertyFlag>`
  `requiredFlags()`
  `String`
  `toString()`
  Prints the immutable value `VMAAllocationCreateInfo` with attribute values.
  `VMAMemoryUsage`
  `usage()`
  `final VMAAllocationCreateInfo`
  `withFlags(VMAAllocationCreateFlag... elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VMAAllocationCreateInfo`
  `withFlags(Iterable<VMAAllocationCreateFlag> elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VMAAllocationCreateInfo`
  `withMemoryTypeBits(long value)`
  Copy the current immutable object by setting a value for the `memoryTypeBits` attribute.
  `final VMAAllocationCreateInfo`
  `withPreferredFlags(VulkanMemoryPropertyFlag... elements)`
  Copy the current immutable object with elements that replace the content of `preferredFlags`.
  `final VMAAllocationCreateInfo`
  `withPreferredFlags(Iterable<VulkanMemoryPropertyFlag> elements)`
  Copy the current immutable object with elements that replace the content of `preferredFlags`.
  `final VMAAllocationCreateInfo`
  `withRequiredFlags(VulkanMemoryPropertyFlag... elements)`
  Copy the current immutable object with elements that replace the content of `requiredFlags`.
  `final VMAAllocationCreateInfo`
  `withRequiredFlags(Iterable<VulkanMemoryPropertyFlag> elements)`
  Copy the current immutable object with elements that replace the content of `requiredFlags`.
  `final VMAAllocationCreateInfo`
  `withUsage(VMAMemoryUsage value)`
  Copy the current immutable object by setting a value for the `usage` attribute.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### flags

    public Set<VMAAllocationCreateFlag> flags()
    Specified by:
      `flags` in interface `VMAAllocationCreateInfoType`
    Returns:
      The creation flags

  - ### usage

    public VMAMemoryUsage usage()
    Specified by:
      `usage` in interface `VMAAllocationCreateInfoType`
    Returns:
      The intended usage of the memory allocation

  - ### requiredFlags

    public Set<VulkanMemoryPropertyFlag> requiredFlags()
    Specified by:
      `requiredFlags` in interface `VMAAllocationCreateInfoType`
    Returns:
      The flags that must be set in a memory type chosen for an allocation.

  - ### preferredFlags

    public Set<VulkanMemoryPropertyFlag> preferredFlags()
    Specified by:
      `preferredFlags` in interface `VMAAllocationCreateInfoType`
    Returns:
      The flags that preferably should be set in a memory type chosen for an allocation.

  - ### memoryTypeBits

    public long memoryTypeBits()
    Specified by:
      `memoryTypeBits` in interface `VMAAllocationCreateInfoType`
    Returns:
      A bitmask containing one bit set for every memory type acceptable for this allocation.

  - ### withFlags

    public final VMAAllocationCreateInfo withFlags(VMAAllocationCreateFlag... 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 VMAAllocationCreateInfo withFlags(Iterable<VMAAllocationCreateFlag> 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

  - ### withUsage

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

  - ### withRequiredFlags

    public final VMAAllocationCreateInfo withRequiredFlags(VulkanMemoryPropertyFlag... elements)
    Copy the current immutable object with elements that replace the content of `requiredFlags`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withRequiredFlags

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

  - ### withPreferredFlags

    public final VMAAllocationCreateInfo withPreferredFlags(VulkanMemoryPropertyFlag... elements)
    Copy the current immutable object with elements that replace the content of `preferredFlags`.
    Parameters:
      `elements` - The elements to set
    Returns:
      A modified copy of `this` object

  - ### withPreferredFlags

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

  - ### withMemoryTypeBits

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

  - ### equals

    public boolean equals(Object another)
    This instance is equal to all instances of `VMAAllocationCreateInfo` 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`, `usage`, `requiredFlags`, `preferredFlags`, `memoryTypeBits`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

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

  - ### copyOf

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

  - ### builder

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

        VMAAllocationCreateInfo.builder()
           .addFlags|addAllFlags(com.io7m.jcoronado.vma.VMAAllocationCreateFlag) // flags elements
           .setUsage(com.io7m.jcoronado.vma.VMAMemoryUsage) // optional usage
           .addRequiredFlags|addAllRequiredFlags(com.io7m.jcoronado.api.VulkanMemoryPropertyFlag) // requiredFlags elements
           .addPreferredFlags|addAllPreferredFlags(com.io7m.jcoronado.api.VulkanMemoryPropertyFlag) // preferredFlags elements
           .setMemoryTypeBits(long) // optional memoryTypeBits
           .build();

    Returns:
      A new VMAAllocationCreateInfo builder