Record Class VisibilityChangeViability
java.lang.Object
java.lang.Record
org.ek9lang.compiler.common.VisibilityChangeViability
- Record Components:
possible- whether the change is structurally possiblereasonCode- a stable machine code for why not (null when possible). EK9 error codes (e.g. "E07250") when the reason mirrors a compiler rule, otherwise a predicate-specific code (e.g. "NO_OP", "OVERRIDE_LOCKED")reason- a human-readable explanation (null when possible)
public record VisibilityChangeViability(boolean possible, String reasonCode, String reason)
extends Record
Outcome of asking whether a member's visibility (access modifier) may be changed to a proposed
value - the "declaration viability" layer used to gate the
change_visibility tooling and
to decide whether the IDE should even offer the refactor.
This answers ONLY whether the proposed modifier is structurally legal on the member (member kind, enclosing genus, override / open state). It does NOT consider whether narrowing the visibility would break existing call sites - that "narrowing safety" check is a separate, reference-graph concern performed by the tool at apply time.
-
Constructor Summary
ConstructorsConstructorDescriptionVisibilityChangeViability(boolean possible, String reasonCode, String reason) Creates an instance of aVisibilityChangeViabilityrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static VisibilityChangeViabilitybooleanpossible()Returns the value of thepossiblerecord component.reason()Returns the value of thereasonrecord component.Returns the value of thereasonCoderecord component.final StringtoString()Returns a string representation of this record class.static VisibilityChangeViabilityviable()
-
Constructor Details
-
VisibilityChangeViability
Creates an instance of aVisibilityChangeViabilityrecord class.- Parameters:
possible- the value for thepossiblerecord componentreasonCode- the value for thereasonCoderecord componentreason- the value for thereasonrecord component
-
-
Method Details
-
viable
-
notViable
-
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. -
possible
-
reasonCode
Returns the value of thereasonCoderecord component.- Returns:
- the value of the
reasonCoderecord component
-
reason
-