Record Class JavaModuleIdentity
java.lang.Object
java.lang.Record
dev.archunitjava.model.JavaModuleIdentity
- All Implemented Interfaces:
Comparable<JavaModuleIdentity>
public record JavaModuleIdentity(JavaModuleKind kind, Optional<String> name, Optional<String> unnamedOrigin)
extends Record
implements Comparable<JavaModuleIdentity>
JPMS identity that never conflates explicit, automatic, and unnamed modules.
-
Constructor Summary
ConstructorsConstructorDescriptionJavaModuleIdentity(JavaModuleKind kind, Optional<String> name, Optional<String> unnamedOrigin) Creates an instance of aJavaModuleIdentityrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaModuleIdentityintcompareTo(JavaModuleIdentity other) final booleanIndicates whether some other object is "equal to" this one.static JavaModuleIdentityfinal inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.static JavaModuleIdentityReturns the value of theunnamedOriginrecord component.
-
Constructor Details
-
JavaModuleIdentity
public JavaModuleIdentity(JavaModuleKind kind, Optional<String> name, Optional<String> unnamedOrigin) Creates an instance of aJavaModuleIdentityrecord class.- Parameters:
kind- the value for thekindrecord componentname- the value for thenamerecord componentunnamedOrigin- the value for theunnamedOriginrecord component
-
-
Method Details
-
explicit
-
automatic
-
unnamed
-
stableKey
-
compareTo
- Specified by:
compareToin interfaceComparable<JavaModuleIdentity>
-
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). -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
name
-
unnamedOrigin
-