Class SwitchExpr.Arm

  • Enclosing class:
    SwitchExpr

    public static final class SwitchExpr.Arm
    extends Object
    One arm.
    • Method Detail

      • isDefault

        public boolean isDefault()
        Returns:
        whether default
      • getPatternType

        public SourceType getPatternType()
        Returns:
        the pattern type
      • getPatternBinding

        public String getPatternBinding()
        Returns:
        the pattern binding
      • getDeconstructionComponents

        public List<SwitchExpr.Component> getDeconstructionComponents()
        Returns:
        the deconstruction components
      • getGuard

        public Expression getGuard()
        Returns:
        the guard
      • getResult

        public Expression getResult()
        Returns:
        the result
      • isTypePattern

        public boolean isTypePattern()
        Returns:
        true if the arm matches on a type pattern rather than constant labels
      • isRecordDeconstruction

        public boolean isRecordDeconstruction()
        Returns:
        true if the arm is a type pattern that also destructures record components
      • setResult

        public void setResult​(Expression result)
        Replaces the value the arm yields; the parent link is not updated.
        Parameters:
        result - the new result expression