- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanVersion
-
- All Implemented Interfaces:
VulkanVersionType
,java.lang.Comparable<VulkanVersionType>
public final class VulkanVersion extends java.lang.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 class
VulkanVersion.Builder
Builds instances of typeVulkanVersion
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VulkanVersion.Builder
builder()
Creates a builder forVulkanVersion
.static VulkanVersion
copyOf(VulkanVersionType instance)
Creates an immutable copy of aVulkanVersionType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanVersion
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 immutableVulkanVersion
instance.int
patch()
java.lang.String
toString()
Prints the immutable valueVulkanVersion
with attribute values.VulkanVersion
withMajor(int value)
Copy the current immutable object by setting a value for themajor
attribute.VulkanVersion
withMinor(int value)
Copy the current immutable object by setting a value for theminor
attribute.VulkanVersion
withPatch(int value)
Copy the current immutable object by setting a value for thepatch
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 Detail
-
major
public int major()
- Specified by:
major
in interfaceVulkanVersionType
- Returns:
- The major version
-
minor
public int minor()
- Specified by:
minor
in interfaceVulkanVersionType
- Returns:
- The minor version
-
patch
public int patch()
- Specified by:
patch
in interfaceVulkanVersionType
- Returns:
- The patch version
-
withMajor
public final VulkanVersion withMajor(int value)
Copy the current immutable object by setting a value for themajor
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 theminor
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 thepatch
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for patch- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofVulkanVersion
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()
Computes a hash code from attributes:major
,minor
,patch
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanVersion
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanVersion of(int major, int minor, int patch)
Construct a new immutableVulkanVersion
instance.- Parameters:
major
- The value for themajor
attributeminor
- The value for theminor
attributepatch
- The value for thepatch
attribute- Returns:
- An immutable VulkanVersion instance
-
copyOf
public static VulkanVersion copyOf(VulkanVersionType instance)
Creates an immutable copy of aVulkanVersionType
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 forVulkanVersion
.- Returns:
- A new VulkanVersion builder
-
-