Package com.io7m.jnoisetype.api
Class NTVersion
java.lang.Object
com.io7m.jnoisetype.api.NTVersion
- All Implemented Interfaces:
NTVersionType
,Comparable<NTVersionType>
A version number.
- See Also:
-
- "SoundFontⓡ Technical Specification 2.04, §5.1, sfVersionTag"
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic NTVersion.Builder
builder()
Creates a builder forNTVersion
.static NTVersion
copyOf
(NTVersionType instance) Creates an immutable copy of aNTVersionType
value.boolean
This instance is equal to all instances ofNTVersion
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:major
,minor
.int
major()
int
minor()
static NTVersion
of
(int major, int minor) Construct a new immutableNTVersion
instance.toString()
Prints the immutable valueNTVersion
with attribute values.final NTVersion
withMajor
(int value) Copy the current immutable object by setting a value for themajor
attribute.final NTVersion
withMinor
(int value) Copy the current immutable object by setting a value for theminor
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.io7m.jnoisetype.api.NTVersionType
checkPreconditions, compareTo
-
Method Details
-
major
public int major()- Specified by:
major
in interfaceNTVersionType
- Returns:
- The major version number
-
minor
public int minor()- Specified by:
minor
in interfaceNTVersionType
- Returns:
- The minor version number
-
withMajor
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
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
-
equals
This instance is equal to all instances ofNTVersion
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:major
,minor
. -
toString
Prints the immutable valueNTVersion
with attribute values. -
of
Construct a new immutableNTVersion
instance.- Parameters:
major
- The value for themajor
attributeminor
- The value for theminor
attribute- Returns:
- An immutable NTVersion instance
-
copyOf
Creates an immutable copy of aNTVersionType
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 NTVersion instance
-
builder
Creates a builder forNTVersion
.NTVersion.builder() .setMajor(int) // required
major
.setMinor(int) // requiredminor
.build();- Returns:
- A new NTVersion builder
-