APIdia Launch Partner
Top Description Methods
java.lang.classfile.instruction

public sealed Interface SwitchCase

permits SwitchCaseImpl
Known Direct Implementers
jdk.internal.classfile.impl.AbstractInstruction.SwitchCaseImpl
Imports
java.lang.classfile.Label, jdk.internal.classfile.impl.AbstractInstruction

Models a single case in a lookupswitch or tableswitch instruction.

A switch case is composite:

SwitchCase( int caseValue, Label target )
SwitchCase(
    int caseValue,
    Label target
)
Since
24
See Also
LookupSwitchInstruction, TableSwitchInstruction

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the integer value corresponding to this case
caseValue
()

Returns the integer value corresponding to this case.

public static SwitchCase

Returns:

a new switch case
of
(int
the integer value for the case
caseValue
,
Label
the branch target for the case
target
)

Returns a new switch case.

public Label

Returns:

the branch target corresponding to this case
target
()

Returns the branch target corresponding to this case.

Method Detail

caseValueback to summary
public int caseValue()

Returns the integer value corresponding to this case.

Returns:int

the integer value corresponding to this case

ofback to summary
public static SwitchCase of(int caseValue, Label target)

Returns a new switch case.

Parameters
caseValue:int

the integer value for the case

target:Label

the branch target for the case

Returns:SwitchCase

a new switch case

targetback to summary
public Label target()

Returns the branch target corresponding to this case.

Returns:Label

the branch target corresponding to this case