private static int constantToValueType(Constant cst) {
    /*
     * TODO: Constant should probable have an associated enum, so this
     * can be a switch().
     */
    if (cst instanceof CstByte) {
      return VALUE_BYTE;
    } else if (cst instanceof CstShort) {
      return VALUE_SHORT;
    } else if (cst instanceof CstChar) {
      return VALUE_CHAR;
    } else if (cst instanceof CstInteger) {
      return VALUE_INT;
    } else if (cst instanceof CstLong) {
      return VALUE_LONG;
    } else if (cst instanceof CstFloat) {
      return VALUE_FLOAT;
    } else if (cst instanceof CstDouble) {
      return VALUE_DOUBLE;
    } else if (cst instanceof CstProtoRef) {
      return VALUE_METHOD_TYPE;
    } else if (cst instanceof CstMethodHandle) {
      return VALUE_METHOD_HANDLE;
    } else if (cst instanceof CstString) {
      return VALUE_STRING;
    } else if (cst instanceof CstType) {
      return VALUE_TYPE;
    } else if (cst instanceof CstFieldRef) {
      return VALUE_FIELD;
    } else if (cst instanceof CstMethodRef) {
      return VALUE_METHOD;
    } else if (cst instanceof CstEnumRef) {
      return VALUE_ENUM;
    } else if (cst instanceof CstArray) {
      return VALUE_ARRAY;
    } else if (cst instanceof CstAnnotation) {
      return VALUE_ANNOTATION;
    } else if (cst instanceof CstKnownNull) {
      return VALUE_NULL;
    } else if (cst instanceof CstBoolean) {
      return VALUE_BOOLEAN;
    } else {
      throw new RuntimeException("Shouldn't happen");
    }
  }
Gets the value type for the given constant.

@param cst {@code non-null;} the constant
@return the value type; one of the {@code VALUE_*} constants defined by this class
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/ValueEncoder.java