Record Class ModuleInfoHash.Coordinate
java.lang.Object
java.lang.Record
com.netflix.module.ModuleInfoHash.Coordinate
- Record Components:
moduleName- the Java module nameversion- the version reported by the module descriptor, if present
- All Implemented Interfaces:
Comparable<ModuleInfoHash.Coordinate>
- Enclosing class:
ModuleInfoHash
public static record ModuleInfoHash.Coordinate(String moduleName, Optional<ModuleDescriptor.Version> version)
extends Record
implements Comparable<ModuleInfoHash.Coordinate>
A module key in a hash file.
-
Constructor Summary
ConstructorsConstructorDescriptionCoordinate(String moduleName) Creates an unversioned module coordinate.Coordinate(String moduleName, String version) Creates a coordinate by parsing a module version.Coordinate(String moduleName, Optional<ModuleDescriptor.Version> version) Validates and creates a module coordinate. -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themoduleNamerecord component.toString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
Coordinate
Validates and creates a module coordinate. -
Coordinate
Creates an unversioned module coordinate.- Parameters:
moduleName- the Java module name
-
Coordinate
Creates a coordinate by parsing a module version.- Parameters:
moduleName- the Java module nameversion- the module version string- Throws:
IllegalArgumentException- if the name or version is invalid
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<ModuleInfoHash.Coordinate>
-
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). -
moduleName
Returns the value of themoduleNamerecord component.- Returns:
- the value of the
moduleNamerecord component
-
version
-