public static byte forType(@Nonnull PType type) {
        switch (type) {
            case VOID: return VOID;
            case BOOL: return BOOL;
            case BYTE: return BYTE;
            case I16: return I16;
            case I32: return I32;
            case I64: return I64;
            case DOUBLE: return DOUBLE;
            case STRING: return STRING;
            case BINARY: return STRING;
            case ENUM: return I32;
            case MAP: return MAP;
            case SET: return SET;
            case LIST: return LIST;
            case MESSAGE: return STRUCT;
            default: throw new IllegalArgumentException("Unknown binary type for " + type.toString());
        }
    }
public static byte forType ( @ Nonnull PType type ) { switch ( type ) { case VOID : return VOID ; case BOOL : return BOOL ; case BYTE : return BYTE ; case I16 : return I16 ; case I32 : return I32 ; case I64 : return I64 ; case DOUBLE : return DOUBLE ; case STRING : return STRING ; case BINARY : return STRING ; case ENUM : return I32 ; case MAP : return MAP ; case SET : return SET ; case LIST : return LIST ; case MESSAGE : return STRUCT ; default : throw new IllegalArgumentException ( "Unknown binary type for " + type . toString ( ) ) ; } }
Get the binary type for the given value type.

@param type The type to check.
@return The binary type ID.