Record Class Redeclaration.Redeclared
java.lang.Object
java.lang.Record
org.ek9lang.compiler.repair.Redeclaration.Redeclared
- Enclosing class:
Redeclaration
public static record Redeclaration.Redeclared(String name, int line, int earlierLine)
extends Record
A second declaration as the E50050 message names it - THE reading of that message for this repair and
for the MCP
RedeclarationHint: the name, the line declaring it again, the line that declared it first.-
Constructor Summary
ConstructorsConstructorDescriptionRedeclared(String name, int line, int earlierLine) Creates an instance of aRedeclaredrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theearlierLinerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intline()Returns the value of thelinerecord component.name()Returns the value of thenamerecord component.static Redeclaration.RedeclaredFrom an E50050 message, or null when it does not name a second declaration of a variable.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Redeclared
Creates an instance of aRedeclaredrecord class.- Parameters:
name- the value for thenamerecord componentline- the value for thelinerecord componentearlierLine- the value for theearlierLinerecord component
-
-
Method Details
-
of
From an E50050 message, or null when it does not name a second declaration of a variable. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
line
public int line()Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
earlierLine
public int earlierLine()Returns the value of theearlierLinerecord component.- Returns:
- the value of the
earlierLinerecord component
-