- java.lang.Object
-
- io.hotmoka.network.values.StorageValueModel
-
public class StorageValueModel extends Object
The model of a storage value.
-
-
Field Summary
Fields Modifier and Type Field Description StringenumElementNameUsed for enumeration values only: it is the name of the element in the enumeration.StorageReferenceModelreferenceUsed for storage references.StringtypeThe type of the value.StringvalueUsed for primitive values, big integers, strings and null.
-
Constructor Summary
Constructors Constructor Description StorageValueModel()StorageValueModel(StorageValue parent)Builds the model of a storage value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StorageValueModelmodelOfValueReturned(MethodCallTransactionRequestModel request, StorageValue returnedValue)Yields the storage value model of the returned value of a method.StorageValuetoBean()Yields the storage value corresponding to this value.
-
-
-
Field Detail
-
value
public String value
Used for primitive values, big integers, strings and null. For the null value, this field holds exactly null, not the string "null".
-
reference
public StorageReferenceModel reference
Used for storage references.
-
type
public String type
The type of the value. For storage references andnull, this is"reference".
-
enumElementName
public String enumElementName
Used for enumeration values only: it is the name of the element in the enumeration.
-
-
Constructor Detail
-
StorageValueModel
public StorageValueModel(StorageValue parent)
Builds the model of a storage value.- Parameters:
parent- the storage value
-
StorageValueModel
public StorageValueModel()
-
-
Method Detail
-
toBean
public StorageValue toBean()
Yields the storage value corresponding to this value.- Returns:
- the storage value
-
modelOfValueReturned
public static StorageValueModel modelOfValueReturned(MethodCallTransactionRequestModel request, StorageValue returnedValue)
Yields the storage value model of the returned value of a method. If the method returns void, its returned value is irrelevant and we fix it tonull.- Parameters:
request- the request that calls the methodreturnedValue- the value returned by the method- Returns:
- the
-
-