# Class VulkanMemoryRequirements

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

All Implemented Interfaces:
  `VulkanMemoryRequirementsType`

public final class VulkanMemoryRequirements extends Object implements VulkanMemoryRequirementsType

See Also:
  - "VkMemoryRequirements"

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `alignment()`
  `static VulkanMemoryRequirements.Builder`
  `builder()`
  Creates a builder for `VulkanMemoryRequirements`.
  `static VulkanMemoryRequirements`
  `copyOf(VulkanMemoryRequirementsType instance)`
  Creates an immutable copy of a `VulkanMemoryRequirementsType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanMemoryRequirements` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `size`, `alignment`, `memoryTypeBits`.
  `int`
  `memoryTypeBits()`
  `long`
  `size()`
  `String`
  `toString()`
  Prints the immutable value `VulkanMemoryRequirements` with attribute values.
  `final VulkanMemoryRequirements`
  `withAlignment(long value)`
  Copy the current immutable object by setting a value for the `alignment` attribute.
  `final VulkanMemoryRequirements`
  `withMemoryTypeBits(int value)`
  Copy the current immutable object by setting a value for the `memoryTypeBits` attribute.
  `final VulkanMemoryRequirements`
  `withSize(long value)`
  Copy the current immutable object by setting a value for the `size` attribute.

  ### Methods inherited from class Object

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

- ## Method Details

  - ### size

    public long size()
    Specified by:
      `size` in interface `VulkanMemoryRequirementsType`
    Returns:
      The size, in bytes, of the memory allocation required for the resource.

  - ### alignment

    public long alignment()
    Specified by:
      `alignment` in interface `VulkanMemoryRequirementsType`
    Returns:
      The alignment, in bytes, of the offset within the allocation required for the resource.

  - ### memoryTypeBits

    public int memoryTypeBits()
    Specified by:
      `memoryTypeBits` in interface `VulkanMemoryRequirementsType`
    Returns:
      A bitmask that contains one bit set for every supported memory type for the resource. Bit i is set if and only if the memory type i in the VkPhysicalDeviceMemoryProperties structure for the physical device is supported for the resource.

  - ### withSize

    public final VulkanMemoryRequirements 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

  - ### withAlignment

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

  - ### withMemoryTypeBits

    public final VulkanMemoryRequirements withMemoryTypeBits(int 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 `VulkanMemoryRequirements` 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: `size`, `alignment`, `memoryTypeBits`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

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

  - ### copyOf

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

  - ### builder

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

        VulkanMemoryRequirements.builder()
           .setSize(long) // optional size
           .setAlignment(long) // optional alignment
           .setMemoryTypeBits(int) // optional memoryTypeBits
           .build();

    Returns:
      A new VulkanMemoryRequirements builder