Record Class ResolvedOrDefineResult
java.lang.Object
java.lang.Record
org.ek9lang.compiler.ResolvedOrDefineResult
public record ResolvedOrDefineResult(Optional<PossibleGenericSymbol> symbol, boolean newlyDefined)
extends Record
Mainly used in the CompilableProgram for resolving or defining a new Parameterized type.
The main issue with defining a Parameterized type is that it must be done in a single operation
inside a lock.
So when we encounter the need for a new parameterized generic type, the appropriate component
creates one and then calls on the CompilableProgram to either 'resolve' one that matches, or use
the one that has been passed in to 'define' that parameterized type. This is because there can and will be
multiple threads running through different sources. They may each find the need for a 'List of String',
the first one gets to define and the rest resolve, hence the need for a lock with a single operation.
But the calling code needs to 'know' if the returned symbol has been newly defined. This is because the
initial creation of the parameterized type will only be a minimal outline (name only), there will be
no methods or dependent types populated.
It is this latter aspect that must be done - BUT only if the parameterized type is newly defined.
- 
Constructor SummaryConstructorsConstructorDescriptionResolvedOrDefineResult(Optional<PossibleGenericSymbol> symbol, boolean newlyDefined) Creates an instance of aResolvedOrDefineResultrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thenewlyDefinedrecord component.symbol()Returns the value of thesymbolrecord component.final StringtoString()Returns a string representation of this record class.
- 
Constructor Details- 
ResolvedOrDefineResultCreates an instance of aResolvedOrDefineResultrecord class.- Parameters:
- symbol- the value for the- symbolrecord component
- newlyDefined- the value for the- newlyDefinedrecord component
 
 
- 
- 
Method Details- 
toString
- 
hashCode
- 
equalsIndicates 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.
- 
symbolReturns the value of thesymbolrecord component.- Returns:
- the value of the symbolrecord component
 
- 
newlyDefinedpublic boolean newlyDefined()Returns the value of thenewlyDefinedrecord component.- Returns:
- the value of the newlyDefinedrecord component
 
 
-