@Test public void testAsString() { assertThat(BinaryType.asString(BinaryType.STOP), is("stop(0)")); assertThat(BinaryType.asString(BinaryType.VOID), is("void(1)")); assertThat(BinaryType.asString(BinaryType.BOOL), is("bool(2)")); assertThat(BinaryType.asString(BinaryType.BYTE), is("byte(3)")); assertThat(BinaryType.asString(BinaryType.DOUBLE), is("double(4)")); assertThat(BinaryType.asString(BinaryType.I16), is("i16(6)")); assertThat(BinaryType.asString(BinaryType.I32), is("i32(8)")); assertThat(BinaryType.asString(BinaryType.I64), is("i64(10)")); assertThat(BinaryType.asString(BinaryType.STRING), is("string(11)")); assertThat(BinaryType.asString(BinaryType.STRUCT), is("struct(12)")); assertThat(BinaryType.asString(BinaryType.MAP), is("map(13)")); assertThat(BinaryType.asString(BinaryType.SET), is("set(14)")); assertThat(BinaryType.asString(BinaryType.LIST), is("list(15)")); assertThat(BinaryType.asString((byte) 7), is("unknown(7)")); }
public static String asString(byte id) { switch (id) { case STOP: return "stop(0)"; case VOID: return "void(1)"; case BOOL: return "bool(2)"; case BYTE: return "byte(3)"; case DOUBLE: return "double(4)"; case I16: return "i16(6)"; case I32: return "i32(8)"; case I64: return "i64(10)"; case STRING: return "string(11)"; case STRUCT: return "struct(12)"; case MAP: return "map(13)"; case SET: return "set(14)"; case LIST: return "list(15)"; default: return "unknown(" + id + ")"; } }
BinaryType { public static String asString(byte id) { switch (id) { case STOP: return "stop(0)"; case VOID: return "void(1)"; case BOOL: return "bool(2)"; case BYTE: return "byte(3)"; case DOUBLE: return "double(4)"; case I16: return "i16(6)"; case I32: return "i32(8)"; case I64: return "i64(10)"; case STRING: return "string(11)"; case STRUCT: return "struct(12)"; case MAP: return "map(13)"; case SET: return "set(14)"; case LIST: return "list(15)"; default: return "unknown(" + id + ")"; } } }
BinaryType { public static String asString(byte id) { switch (id) { case STOP: return "stop(0)"; case VOID: return "void(1)"; case BOOL: return "bool(2)"; case BYTE: return "byte(3)"; case DOUBLE: return "double(4)"; case I16: return "i16(6)"; case I32: return "i32(8)"; case I64: return "i64(10)"; case STRING: return "string(11)"; case STRUCT: return "struct(12)"; case MAP: return "map(13)"; case SET: return "set(14)"; case LIST: return "list(15)"; default: return "unknown(" + id + ")"; } } private  BinaryType(); }
BinaryType { public static String asString(byte id) { switch (id) { case STOP: return "stop(0)"; case VOID: return "void(1)"; case BOOL: return "bool(2)"; case BYTE: return "byte(3)"; case DOUBLE: return "double(4)"; case I16: return "i16(6)"; case I32: return "i32(8)"; case I64: return "i64(10)"; case STRING: return "string(11)"; case STRUCT: return "struct(12)"; case MAP: return "map(13)"; case SET: return "set(14)"; case LIST: return "list(15)"; default: return "unknown(" + id + ")"; } } private  BinaryType(); static byte forType(@Nonnull PType type); static String asString(byte id); }
BinaryType { public static String asString(byte id) { switch (id) { case STOP: return "stop(0)"; case VOID: return "void(1)"; case BOOL: return "bool(2)"; case BYTE: return "byte(3)"; case DOUBLE: return "double(4)"; case I16: return "i16(6)"; case I32: return "i32(8)"; case I64: return "i64(10)"; case STRING: return "string(11)"; case STRUCT: return "struct(12)"; case MAP: return "map(13)"; case SET: return "set(14)"; case LIST: return "list(15)"; default: return "unknown(" + id + ")"; } } private  BinaryType(); static byte forType(@Nonnull PType type); static String asString(byte id); static final byte STOP; static final byte VOID; static final byte BOOL; static final byte BYTE; static final byte DOUBLE; static final byte I16; static final byte I32; static final byte I64; static final byte STRING; static final byte STRUCT; static final byte MAP; static final byte SET; static final byte LIST; }