# Class VulkanMappedMemoryRange

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

All Implemented Interfaces:
  `VulkanMappedMemoryRangeType`

public final class VulkanMappedMemoryRange extends Object implements VulkanMappedMemoryRangeType

See Also:
  - "VkMappedMemoryRange"

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VulkanMappedMemoryRange.Builder`
  `builder()`
  Creates a builder for `VulkanMappedMemoryRange`.
  `static VulkanMappedMemoryRange`
  `copyOf(VulkanMappedMemoryRangeType instance)`
  Creates an immutable copy of a `VulkanMappedMemoryRangeType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanMappedMemoryRange` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `memory`, `offset`, `size`.
  `VulkanDeviceMemoryType`
  `memory()`
  `static VulkanMappedMemoryRange`
  `of(VulkanDeviceMemoryType memory, long offset, long size)`
  Construct a new immutable `VulkanMappedMemoryRange` instance.
  `long`
  `offset()`
  `long`
  `size()`
  `String`
  `toString()`
  Prints the immutable value `VulkanMappedMemoryRange` with attribute values.
  `final VulkanMappedMemoryRange`
  `withMemory(VulkanDeviceMemoryType value)`
  Copy the current immutable object by setting a value for the `memory` attribute.
  `final VulkanMappedMemoryRange`
  `withOffset(long value)`
  Copy the current immutable object by setting a value for the `offset` attribute.
  `final VulkanMappedMemoryRange`
  `withSize(long value)`
  Copy the current immutable object by setting a value for the `size` attribute.

  ### Methods inherited from class java.lang.Object

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

- ## Method Details

  - ### memory

    public VulkanDeviceMemoryType memory()
    Specified by:
      `memory` in interface `VulkanMappedMemoryRangeType`
    Returns:
      The memory object to which this range belongs.

  - ### offset

    public long offset()
    Specified by:
      `offset` in interface `VulkanMappedMemoryRangeType`
    Returns:
      The zero-based byte offset from the beginning of the memory object.

  - ### size

    public long size()
    Specified by:
      `size` in interface `VulkanMappedMemoryRangeType`
    Returns:
      Either the size of range, or VK_WHOLE_SIZE to affect the range from offset to the end of the current mapping of the allocation.

  - ### withMemory

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

  - ### withOffset

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

  - ### withSize

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

  - ### equals

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

  - ### toString

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

  - ### of

    public static VulkanMappedMemoryRange of(VulkanDeviceMemoryType memory, long offset, long size)
    Construct a new immutable `VulkanMappedMemoryRange` instance.
    Parameters:
      `memory` - The value for the `memory` attribute
      `offset` - The value for the `offset` attribute
      `size` - The value for the `size` attribute
    Returns:
      An immutable VulkanMappedMemoryRange instance

  - ### copyOf

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

  - ### builder

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

         VulkanMappedMemoryRange.builder()
            .setMemory(com.io7m.jcoronado.api.VulkanDeviceMemoryType) // required memory
            .setOffset(long) // required offset
            .setSize(long) // required size
            .build();

    Returns:
      A new VulkanMappedMemoryRange builder