Package org.dellroad.stuff.java
Class PrimitiveSwitchAdapter<R>
java.lang.Object
org.dellroad.stuff.java.PrimitiveSwitchAdapter<R>
- Type Parameters:
R
- switch method return type
- All Implemented Interfaces:
PrimitiveSwitch<R>
Adapter class for
PrimitiveSwitch
implementations.- Since:
- 1.0.65
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionHandle thePrimitive.BOOLEAN
case.caseByte()
Handle thePrimitive.BYTE
case.Handle thePrimitive.CHARACTER
case.protected R
Internal roll-up method.Handle thePrimitive.DOUBLE
case.Handle thePrimitive.FLOAT
case.Handle thePrimitive.INTEGER
case.caseLong()
Handle thePrimitive.LONG
case.protected R
Internal roll-up method.Handle thePrimitive.SHORT
case.caseVoid()
Handle thePrimitive.VOID
case.
-
Constructor Details
-
PrimitiveSwitchAdapter
public PrimitiveSwitchAdapter()
-
-
Method Details
-
caseVoid
Handle thePrimitive.VOID
case. The implementation inPrimitiveSwitchAdapter
delegates tocaseDefault()
.- Specified by:
caseVoid
in interfacePrimitiveSwitch<R>
-
caseBoolean
Handle thePrimitive.BOOLEAN
case. The implementation inPrimitiveSwitchAdapter
delegates tocaseDefault()
.- Specified by:
caseBoolean
in interfacePrimitiveSwitch<R>
-
caseByte
Handle thePrimitive.BYTE
case. The implementation inPrimitiveSwitchAdapter
delegates tocaseNumber()
.- Specified by:
caseByte
in interfacePrimitiveSwitch<R>
-
caseCharacter
Handle thePrimitive.CHARACTER
case. The implementation inPrimitiveSwitchAdapter
delegates tocaseDefault()
.- Specified by:
caseCharacter
in interfacePrimitiveSwitch<R>
-
caseShort
Handle thePrimitive.SHORT
case. The implementation inPrimitiveSwitchAdapter
delegates tocaseNumber()
.- Specified by:
caseShort
in interfacePrimitiveSwitch<R>
-
caseInteger
Handle thePrimitive.INTEGER
case. The implementation inPrimitiveSwitchAdapter
delegates tocaseNumber()
.- Specified by:
caseInteger
in interfacePrimitiveSwitch<R>
-
caseFloat
Handle thePrimitive.FLOAT
case. The implementation inPrimitiveSwitchAdapter
delegates tocaseNumber()
.- Specified by:
caseFloat
in interfacePrimitiveSwitch<R>
-
caseLong
Handle thePrimitive.LONG
case. The implementation inPrimitiveSwitchAdapter
delegates tocaseNumber()
.- Specified by:
caseLong
in interfacePrimitiveSwitch<R>
-
caseDouble
Handle thePrimitive.DOUBLE
case. The implementation inPrimitiveSwitchAdapter
delegates tocaseNumber()
.- Specified by:
caseDouble
in interfacePrimitiveSwitch<R>
-
caseNumber
Internal roll-up method. The implementation inPrimitiveSwitchAdapter
delegates tocaseDefault()
.- Returns:
- default result for sub-types of
Number
-
caseDefault
Internal roll-up method. The implementation inPrimitiveSwitchAdapter
returnsnull
.- Returns:
- default result
-