# Class VulkanVersion

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

All Implemented Interfaces:
  `VulkanVersionType`, `Comparable<VulkanVersionType>`

public final class VulkanVersion extends Object implements VulkanVersionType
A Vulkan API version consisting of a major, minor, and patch component.

- ## Nested Class Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VulkanVersion.Builder`
  `builder()`
  Creates a builder for `VulkanVersion`.
  `static VulkanVersion`
  `copyOf(VulkanVersionType instance)`
  Creates an immutable copy of a `VulkanVersionType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanVersion` that have equal attribute values.
  `int`
  `hashCode()`
  Computes a hash code from attributes: `major`, `minor`, `patch`.
  `int`
  `major()`
  `int`
  `minor()`
  `static VulkanVersion`
  `of(int major, int minor, int patch)`
  Construct a new immutable `VulkanVersion` instance.
  `int`
  `patch()`
  `String`
  `toString()`
  Prints the immutable value `VulkanVersion` with attribute values.
  `final VulkanVersion`
  `withMajor(int value)`
  Copy the current immutable object by setting a value for the `major` attribute.
  `final VulkanVersion`
  `withMinor(int value)`
  Copy the current immutable object by setting a value for the `minor` attribute.
  `final VulkanVersion`
  `withPatch(int value)`
  Copy the current immutable object by setting a value for the `patch` attribute.

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

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

  ### Methods inherited from interface com.io7m.jcoronado.api.VulkanVersionType

  `compareTo, toHumanString`

- ## Method Details

  - ### major

    public int major()
    Specified by:
      `major` in interface `VulkanVersionType`
    Returns:
      The major version

  - ### minor

    public int minor()
    Specified by:
      `minor` in interface `VulkanVersionType`
    Returns:
      The minor version

  - ### patch

    public int patch()
    Specified by:
      `patch` in interface `VulkanVersionType`
    Returns:
      The patch version

  - ### withMajor

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

  - ### withMinor

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

  - ### withPatch

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

  - ### equals

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

  - ### toString

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

  - ### of

    public static VulkanVersion of(int major, int minor, int patch)
    Construct a new immutable `VulkanVersion` instance.
    Parameters:
      `major` - The value for the `major` attribute
      `minor` - The value for the `minor` attribute
      `patch` - The value for the `patch` attribute
    Returns:
      An immutable VulkanVersion instance

  - ### copyOf

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

  - ### builder

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

         VulkanVersion.builder()
            .setMajor(int) // required major
            .setMinor(int) // required minor
            .setPatch(int) // required patch
            .build();

    Returns:
      A new VulkanVersion builder