Record Class Version
java.lang.Object
java.lang.Record
dev.wyck.factory.Version
- Record Components:
applicable- the versions that this version is applicable toid- the version IDtype- the type of version
@NullMarked
@AsOf("2.0.0")
public record Version(String[] applicable, String id, Version.Type type)
extends Record
A record class representing a version of Minecraft.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionVersion(String[] applicable, String id, Version.Type type) Creates an instance of aVersionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns the value of theapplicablerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the message associated with the version.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanisApplicable(String version) Checks if the version is applicable to the given version.static Versionof(Version.Type type, String id, String... applicable) Creates a new Version instance.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Version
Creates an instance of aVersionrecord class.- Parameters:
applicable- the value for theapplicablerecord componentid- the value for theidrecord componenttype- the value for thetyperecord component
-
-
Method Details
-
getMessage
-
isApplicable
-
of
Creates a new Version instance.- Parameters:
type- the type of versionid- the version IDapplicable- the versions that this version is applicable to- Returns:
- a new Version instance
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
applicable
Returns the value of theapplicablerecord component.- Returns:
- the value of the
applicablerecord component
-
id
-
type
-