ResultDBUtil

public final class ResultDBUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.result.resultdb.ResultDBUtil


ResultDB 回報器的工具類別。

摘要

公用建構函式

ResultDBUtil()

公用方法

static String bytesToHex(byte[] bytes)

將位元組陣列轉換為十六進位字串。

static String makeValidKey(String key)

請確認金鑰適用於 ResultDB。

static String truncateString(String input, int maxBytes)

將字串截斷至指定的位元組上限,避免分割多位元組字元。

公用建構函式

ResultDBUtil

public ResultDBUtil ()

公用方法

bytesToHex

public static String bytesToHex (byte[] bytes)

將位元組陣列轉換為十六進位字串。

參數
bytes byte

傳回
String

makeValidKey

public static String makeValidKey (String key)

請確認金鑰是否適用於 ResultDB。

鍵則必須符合下列規則運算式:^[a-z][a-z0-9_]*(/[a-z][a-z0-9_]*)*$

參數
key String

傳回
String

truncateString

public static String truncateString (String input, 
                int maxBytes)

將字串截斷至指定的位元組上限,避免分割多位元組字元。

參數
input String:要截斷的字串

maxBytes int:要截斷至的位元組數量上限 (以 UTF-8 編碼為單位)

傳回
String 截斷的字串