執行屬性
public class ExecutionProperties
extends Object
java.lang.Object | |
↳ | com.android.tradefed.invoker.ExecutionProperties |
在執行測試或調用期間生成的屬性。
建議通過適當使用命名空間使鍵唯一,以避免交叉測試重疊。
概括
公共方法 | |
---|---|
void | clear () 清除執行屬性。 |
boolean | containsKey (String key) 如果此映射包含指定鍵的映射,則返回 |
String | get (String key) 返回指定鍵映射到的值,如果此映射不包含鍵的映射,則返回 |
ImmutableMap<String, String> | getAll () 返回地圖副本中的所有屬性 |
boolean | isEmpty () 返回屬性映射是否為空。 |
String | put (String key, String value) 將指定值與此映射中的指定鍵相關聯。 |
ExecutionProperties | putAll ( properties) putAll ( properties) 將指定映射中的所有映射複製到此映射。 |
String | putIfAbsent (String key, String value) 如果指定的鍵尚未與值關聯,則將其與給定值關聯。 |
String | remove (String key) 如果存在,則從此映射中刪除鍵的映射(可選操作)。 |
String | toString () |
公共方法
清除
public void clear ()
清除執行屬性。在重置隔離期間使用以刪除 exec 數據。
包含密鑰
public boolean containsKey (String key)
如果此映射包含指定鍵的映射,則返回true
。
參數 | |
---|---|
key | String : 要測試其在此映射中是否存在的鍵 |
退貨 | |
---|---|
boolean | 如果此映射包含指定鍵的映射, true |
得到
public String get (String key)
返回指定鍵映射到的值,如果此映射不包含鍵的映射,則返回null
。
參數 | |
---|---|
key | String : 要返回其關聯值的鍵 |
退貨 | |
---|---|
String | 指定鍵映射到的值,如果此映射不包含鍵的映射,則null |
得到所有
public ImmutableMap<String, String> getAll ()
返回地圖副本中的所有屬性
退貨 | |
---|---|
ImmutableMap<String, String> |
是空的
public boolean isEmpty ()
返回屬性映射是否為空。
退貨 | |
---|---|
boolean |
放
public String put (String key, String value)
將指定值與此映射中的指定鍵相關聯。
參數 | |
---|---|
key | String : 與指定值關聯的鍵 |
value | String : 要與指定鍵關聯的值 |
退貨 | |
---|---|
String | 與key 關聯的先前值,如果沒有key 的映射,則為null 。 |
也可以看看:
把所有
public ExecutionProperties putAll (properties)
將指定映射中的所有映射複製到此映射。
參數 | |
---|---|
properties |
退貨 | |
---|---|
ExecutionProperties | 最後的映射 |
putIfAbsent
public String putIfAbsent (String key, String value)
如果指定的鍵尚未與值關聯,則將其與給定值關聯。
參數 | |
---|---|
key | String : 與指定值關聯的鍵 |
value | String : 要與指定鍵關聯的值 |
退貨 | |
---|---|
String | 與指定鍵關聯的先前值,如果鍵沒有映射,則null 。 |
消除
public String remove (String key)
如果存在,則從此映射中刪除鍵的映射(可選操作)。
參數 | |
---|---|
key | String : 要從映射中刪除其映射的鍵 |
退貨 | |
---|---|
String | 與key 關聯的先前值,如果沒有key 的映射,則為null 。 |
到字符串
public String toString ()
退貨 | |
---|---|
String |