public static String print ( PrimitiveType type ) { return type . match ( new PrimitiveType . MatchBlock < String > ( ) { @ Override public String _case ( BooleanType x ) { return "boolean" ; } @ Override public String _case ( ByteType x ) { return "byte" ; } @ Override public String _case ( CharType x ) { return "char" ; } @ Override public String _case ( DoubleType x ) { return "double" ; } @ Override public String _case ( FloatType x ) { return "float" ; } @ Override public String _case ( IntType x ) { return "int" ; } @ Override public String _case ( LongType x ) { return "long" ; } @ Override public String _case ( ShortType x ) { return "short" ; } } ) ; }
Prints a primitive type as boolean | char | short | int | long | float | double