# Class VulkanMemoryType

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

All Implemented Interfaces:
  `VulkanMemoryTypeType`

public final class VulkanMemoryType extends Object implements VulkanMemoryTypeType
A memory type.

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VulkanMemoryType.Builder`
  `builder()`
  Creates a builder for `VulkanMemoryType`.
  `static VulkanMemoryType`
  `copyOf(VulkanMemoryTypeType instance)`
  Creates an immutable copy of a `VulkanMemoryTypeType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanMemoryType` that have equal attribute values.
  `Set<VulkanMemoryPropertyFlag>`
  `flags()`
  `int`
  `hashCode()`
  Computes a hash code from attributes: `index`, `heapIndex`, `flags`.
  `VulkanMemoryHeapIndex`
  `heapIndex()`
  `VulkanMemoryTypeIndex`
  `index()`
  `String`
  `toString()`
  Prints the immutable value `VulkanMemoryType` with attribute values.
  `final VulkanMemoryType`
  `withFlags(VulkanMemoryPropertyFlag... elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VulkanMemoryType`
  `withFlags(Iterable<VulkanMemoryPropertyFlag> elements)`
  Copy the current immutable object with elements that replace the content of `flags`.
  `final VulkanMemoryType`
  `withHeapIndex(VulkanMemoryHeapIndex value)`
  Copy the current immutable object by setting a value for the `heapIndex` attribute.
  `final VulkanMemoryType`
  `withIndex(VulkanMemoryTypeIndex value)`
  Copy the current immutable object by setting a value for the `index` attribute.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### index

    public VulkanMemoryTypeIndex index()
    Specified by:
      `index` in interface `VulkanMemoryTypeType`
    Returns:
      The type index

  - ### heapIndex

    public VulkanMemoryHeapIndex heapIndex()
    Specified by:
      `heapIndex` in interface `VulkanMemoryTypeType`
    Returns:
      The memory heap to which this memory type corresponds

  - ### flags

    public Set<VulkanMemoryPropertyFlag> flags()
    Specified by:
      `flags` in interface `VulkanMemoryTypeType`
    Returns:
      The properties of the heap

  - ### withIndex

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

  - ### withHeapIndex

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

  - ### withFlags

    public final VulkanMemoryType withFlags(VulkanMemoryPropertyFlag... 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 VulkanMemoryType withFlags(Iterable<VulkanMemoryPropertyFlag> 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

  - ### equals

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

  - ### toString

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

  - ### copyOf

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

  - ### builder

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

        VulkanMemoryType.builder()
           .setIndex(com.io7m.jcoronado.api.VulkanMemoryTypeIndex) // required index
           .setHeapIndex(com.io7m.jcoronado.api.VulkanMemoryHeapIndex) // required heapIndex
           .addFlags|addAllFlags(com.io7m.jcoronado.api.VulkanMemoryPropertyFlag) // flags elements
           .build();

    Returns:
      A new VulkanMemoryType builder