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.
  • 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 or 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 or 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 or 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
    • 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) // optional major
         .setMinor(int) // optional minor
         .setPatch(int) // optional patch
         .build();
      
      Returns:
      A new VulkanVersion builder