執行文件
public class ExecutionFiles
extends Object
java.lang.Object | |
↳ | com.android.tradefed.invoker.ExecutionFiles |
測試或調用執行過程中產生的文件依賴,需要攜帶進行測試。該對象由所有調用(測試、模塊等)共享。
概括
公共方法 | |
---|---|
void | clearFiles () 刪除所有被跟踪但未標記為“不應刪除”的文件。 |
boolean | containsKey (String key) 如果此映射包含指定鍵的映射,則返回 |
File | get ( ExecutionFiles.FilesKey key) 具有已知密鑰的 |
File | get (String key) 返回指定鍵映射到的值,如果此映射不包含鍵的映射,則返回 |
ImmutableMap<String, File> | getAll () 返回地圖副本中的所有屬性 |
boolean | isEmpty () 返回屬性映射是否為空。 |
File | put ( ExecutionFiles.FilesKey key, File value) 具有已知密鑰的 |
File | put ( ExecutionFiles.FilesKey key, File value, boolean shouldNotDelete) |
File | put (String key, File value) 將指定值與此映射中的指定鍵相關聯。 |
ExecutionFiles | putAll ( properties) putAll ( properties) 將指定映射中的所有映射複製到此映射。 |
File | putIfAbsent (String key, File value) 如果指定的鍵尚未與值關聯,則將其與給定值關聯。 |
File | remove (String key) 如果存在,則從此映射中刪除鍵的映射(可選操作)。 |
公共方法
清除文件
public void clearFiles ()
刪除所有被跟踪但未標記為“不應刪除”的文件。
包含密鑰
public boolean containsKey (String key)
如果此映射包含指定鍵的映射,則返回true
。
參數 | |
---|---|
key | String : 要測試其在此映射中是否存在的鍵 |
退貨 | |
---|---|
boolean | 如果此映射包含指定鍵的映射, true |
得到
public File get (ExecutionFiles.FilesKey key)
具有已知密鑰的get(String)
變體。
參數 | |
---|---|
key | ExecutionFiles.FilesKey :要返回其關聯值的鍵 |
退貨 | |
---|---|
File | 指定鍵映射到的值,如果此映射不包含鍵的映射,則null |
得到
public File get (String key)
返回指定鍵映射到的值,如果此映射不包含鍵的映射,則返回null
。
參數 | |
---|---|
key | String : 要返回其關聯值的鍵 |
退貨 | |
---|---|
File | 指定鍵映射到的值,如果此映射不包含鍵的映射,則null |
得到所有
public ImmutableMap<String, File> getAll ()
返回地圖副本中的所有屬性
退貨 | |
---|---|
ImmutableMap<String, File> |
是空的
public boolean isEmpty ()
返回屬性映射是否為空。
退貨 | |
---|---|
boolean |
放
public File put (ExecutionFiles.FilesKey key, File value)
具有已知密鑰的put(String, File)
變體。
參數 | |
---|---|
key | ExecutionFiles.FilesKey :與指定值關聯的鍵 |
value | File :要與指定鍵關聯的值 |
退貨 | |
---|---|
File | 與key 關聯的先前值,如果沒有key 的映射,則為null 。 |
放
public File put (ExecutionFiles.FilesKey key, File value, boolean shouldNotDelete)
put(com.android.tradefed.invoker.ExecutionFiles.FilesKey, File)
的變體,帶有防止文件在調用結束時被刪除的選項。
參數 | |
---|---|
key | ExecutionFiles.FilesKey :與指定值關聯的鍵 |
value | File :要與指定鍵關聯的值 |
shouldNotDelete | boolean : 防止文件在調用結束時被刪除。 |
退貨 | |
---|---|
File | 與key 關聯的先前值,如果沒有key 的映射,則為null 。 |
放
public File put (String key, File value)
將指定值與此映射中的指定鍵相關聯。
參數 | |
---|---|
key | String : 與指定值關聯的鍵 |
value | File :要與指定鍵關聯的值 |
退貨 | |
---|---|
File | 與key 關聯的先前值,如果沒有key 的映射,則為null 。 |
也可以看看:
把所有
public ExecutionFiles putAll (properties)
將指定映射中的所有映射複製到此映射。
參數 | |
---|---|
properties |
退貨 | |
---|---|
ExecutionFiles | 最後的映射 |
putIfAbsent
public File putIfAbsent (String key, File value)
如果指定的鍵尚未與值關聯,則將其與給定值關聯。
參數 | |
---|---|
key | String : 與指定值關聯的鍵 |
value | File :要與指定鍵關聯的值 |
退貨 | |
---|---|
File | 與指定鍵關聯的先前值,如果鍵沒有映射,則null 。 |
消除
public File remove (String key)
如果存在,則從此映射中刪除鍵的映射(可選操作)。
參數 | |
---|---|
key | String : 要從映射中刪除其映射的鍵 |
退貨 | |
---|---|
File | 與key 關聯的先前值,如果沒有key 的映射,則為null 。 |