public class AssetResult extends Object
The result consists of the result code, result details, and the number of data records in the returned result. Meanings of the three variables may vary depending on the method in which they are used.
SystemCapability.Security#ASSET| 限定符和类型 | 字段 | 说明 |
|---|---|---|
int |
resultCode |
Indicates the result code returned after an operation is performed.
|
List<String> |
resultInfo |
Indicates the result details returned after an operation is performed.
|
int |
resultNumber |
Indicates the number of data records in the returned result of an operation.
|
| 构造器 | 说明 |
|---|---|
AssetResult(int resultCode) |
A constructor used to create and initialize an
AssetResult instance based on the operation result code. |
AssetResult(int resultCode,
List<String> resultInfo) |
A constructor used to create and initialize an
AssetResult instance based on the operation result code
and details. |
AssetResult(int resultCode,
List<String> resultInfo,
int resultNumber) |
A constructor used to create and initialize an
AssetResult instance based on the operation result code,
result details, and the number of data records in the operation result. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getResultCode() |
Obtains the result code returned after an operation is performed.
|
List<String> |
getResultInfo() |
Obtains the result details returned after an operation is performed.
|
int |
getResultNumber() |
Obtains the number of data records in the returned result of an operation.
|
public final int resultCode
public final List<String> resultInfo
public final int resultNumber
This parameter is reserved.
public AssetResult(int resultCode)
AssetResult instance based on the operation result code.resultCode - Indicates the operation result code.
By default, resultInfo in the AssetResult instance is null, and the number of data
records is 0.
public AssetResult(int resultCode,
List<String> resultInfo)
AssetResult instance based on the operation result code
and details.resultCode - Indicates the operation result code.resultInfo - Indicates the operation result details.
By default, the number of data records in the operation result is 0.
public AssetResult(int resultCode,
List<String> resultInfo,
int resultNumber)
AssetResult instance based on the operation result code,
result details, and the number of data records in the operation result.resultCode - Indicates the operation result code.resultInfo - Indicates the operation result details.resultNumber - Indicates the number of data records in the operation result.public int getResultCode()
AssetOperator#SUCCESS
AssetOperator#ERROR_CODE_INVALID_ARGUMENT
AssetOperator#ERROR_CODE_PERMISSION_DENIED
AssetOperator#ERROR_CODE_UNINITIALIZED
AssetOperator#ERROR_CODE_DATABASE_ERROR
AssetOperator#ERROR_CODE_UNSECURED_ENVIRONMENT
AssetOperator#ERROR_CODE_SYSTEM_ERROR
public List<String> getResultInfo()
For example, the index of asset data is returned in the result of the operation to encrypt and store asset data.
public int getResultNumber()