コード例 #1
0
ファイル: GlobalValues.java プロジェクト: matrixx567/risev2g
  /*
   * This method needs the second parameter from type GlobalTypes to distinguish between byte array
   * values which may be equal.
   */
  public static String toString(byte globalValue, GlobalTypes globalType) {
    String globalFound = "";

    for (GlobalValues glValue : GlobalValues.values()) {
      if (glValue.type == globalType && glValue.byteValue == globalValue) {
        globalFound = glValue.toString();
        break;
      }
    }

    return globalFound;
  }
コード例 #2
0
ファイル: GlobalValues.java プロジェクト: matrixx567/risev2g
  /*
   * This method needs the second parameter from type GlobalTypes to distinguish between byte
   * values which may be equal, e.g. TRANSPORT_PROTOCOL and SECURITY, which both may take values
   * such as 0x00 or 0x01.
   */
  public static String toString(byte[] globalValue, GlobalTypes globalType) {
    String globalFound = "";

    for (GlobalValues glValue : GlobalValues.values()) {
      if (glValue.type == globalType && Arrays.equals(glValue.byteArrayValue, globalValue)) {
        globalFound = glValue.toString();
        break;
      }
    }

    return globalFound;
  }