Record Class ClassModifierChangeViability
java.lang.Object
java.lang.Record
org.ek9lang.compiler.common.ClassModifierChangeViability
- Record Components:
possible- whether the change is structurally possiblereasonCode- a stable machine code for why not (null when possible). Predicate-specific codes such as "NO_OP", "TARGET_IS_ABSTRACT", "HAS_ABSTRACT_MEMBERS"reason- a human-readable explanation (null when possible)conflicts- structured list of blocking items (empty when possible or when not applicable)
public record ClassModifierChangeViability(boolean possible, String reasonCode, String reason, List<Map<String,Object>> conflicts)
extends Record
Outcome of asking whether a class's modifier (
as open / as abstract) may be
changed — the "declaration viability" layer used to gate the class-modifier toggle tooling and
to decide whether the IDE should even offer the refactor.
Mirrors VisibilityChangeViability but adds a structured conflicts list for
cases where the change is blocked by external dependencies (e.g. subtypes that would break if
a class is made closed, or abstract methods that prevent making a class concrete).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassModifierChangeViabilityReturns the value of theconflictsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static ClassModifierChangeViabilitybooleanpossible()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 ClassModifierChangeViabilityviable()
-
Constructor Details
-
ClassModifierChangeViability
public ClassModifierChangeViability(boolean possible, String reasonCode, String reason, List<Map<String, Object>> conflicts) Creates an instance of aClassModifierChangeViabilityrecord class.- Parameters:
possible- the value for thepossiblerecord componentreasonCode- the value for thereasonCoderecord componentreason- the value for thereasonrecord componentconflicts- the value for theconflictsrecord component
-
-
Method Details
-
viable
-
notViable
-
blocked
-
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
-
conflicts
-