- All Superinterfaces:
Comparable<StorageValue>,io.hotmoka.marshalling.api.Marshallable
- All Known Subinterfaces:
BigIntegerValue,BooleanValue,ByteValue,CharValue,DoubleValue,FloatValue,IntValue,LongValue,NullValue,ShortValue,StorageReference,StringValue
public interface StorageValue
extends io.hotmoka.marshalling.api.Marshallable, Comparable<StorageValue>
A value that can be stored in the store of a Hotmoka node, passed as argument
or returned between the outside world and the node.
-
Method Summary
Modifier and TypeMethodDescription<E extends Exception>
BigIntegerasBigInteger(Function<StorageValue, ? extends E> exception) Yields this value as a big integer, if it is a big integer.<E extends Exception>
booleanasBoolean(Function<StorageValue, ? extends E> exception) Yields this value as a boolean, if it is a boolean.<E extends Exception>
byteasByte(Function<StorageValue, ? extends E> exception) Yields this value as a byte, if it is a byte.<E extends Exception>
charasChar(Function<StorageValue, ? extends E> exception) Yields this value as a char, if it is a char.<E extends Exception>
doubleasDouble(Function<StorageValue, ? extends E> exception) Yields this value as a double, if it is a double.<E extends Exception>
floatasFloat(Function<StorageValue, ? extends E> exception) Yields this value as a float, if it is a float.<E extends Exception>
intasInt(Function<StorageValue, ? extends E> exception) Yields this value as an int, if it is an int.<E extends Exception>
longasLong(Function<StorageValue, ? extends E> exception) Yields this value as a long, if it is a long.<E extends Exception>
StorageReferenceasReference(Function<StorageValue, ? extends E> exception) Yields this value as a reference, if it is a reference.<E extends Exception>
BigIntegerasReturnedBigInteger(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a big integer, assuming that it is returned by the given method.<E extends Exception>
booleanasReturnedBoolean(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a boolean, assuming that it is returned by the given method.<E extends Exception>
byteasReturnedByte(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a byte, assuming that it is returned by the given method.<E extends Exception>
charasReturnedChar(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a char, assuming that it is returned by the given method.<E extends Exception>
doubleasReturnedDouble(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a double, assuming that it is returned by the given method.<E extends Exception>
floatasReturnedFloat(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a float, assuming that it is returned by the given method.<E extends Exception>
intasReturnedInt(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as an int, assuming that it is returned by the given method.<E extends Exception>
longasReturnedLong(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a long, assuming that it is returned by the given method.<E extends Exception>
StorageReferenceasReturnedReference(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a reference, assuming that it is returned by the given method.<E extends Exception>
shortasReturnedShort(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a short, assuming that it is returned by the given method.asReturnedString(NonVoidMethodSignature method, Function<String, ? extends E> exception) Yields this value as a string, assuming that it is returned by the given method.<E extends Exception>
shortasShort(Function<StorageValue, ? extends E> exception) Yields this value as a short, if it is a short.asString(Function<StorageValue, ? extends E> exception) Yields this value as a string, if it is a string.booleaninthashCode()toString()Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface io.hotmoka.marshalling.api.Marshallable
into, size, toByteArray
-
Method Details
-
equals
-
hashCode
int hashCode() -
toString
String toString() -
asBigInteger
<E extends Exception> BigInteger asBigInteger(Function<StorageValue, ? extends E> exception) throws EYields this value as a big integer, if it is a big integer.- Type Parameters:
E- the type of the exception thrown if this value is not a big integer- Parameters:
exception- the supplier of the exception thrown if this value is not a big integer- Returns:
- the value, as a big integer
- Throws:
E- if this value is not a big integer
-
asReturnedBigInteger
<E extends Exception> BigInteger asReturnedBigInteger(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a big integer, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a big integer- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a big integer; it receives a string clarifying that the method was expected to return a big integer while it returned another kind of storage value- Returns:
- the value, as a big integer
- Throws:
E- if this value is not a big integer
-
asBoolean
Yields this value as a boolean, if it is a boolean.- Type Parameters:
E- the type of the exception thrown if this value is not a boolean- Parameters:
exception- the supplier of the exception thrown if this value is not a boolean- Returns:
- the value, as a boolean
- Throws:
E- if this value is not a boolean
-
asReturnedBoolean
<E extends Exception> boolean asReturnedBoolean(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a boolean, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a boolean- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a boolean; it receives a string clarifying that the method was expected to return a boolean while it returned another kind of storage value- Returns:
- the value, as a boolean
- Throws:
E- if this value is not a boolean
-
asByte
Yields this value as a byte, if it is a byte.- Type Parameters:
E- the type of the exception thrown if this value is not a byte- Parameters:
exception- the supplier of the exception thrown if this value is not a byte- Returns:
- the value, as a byte
- Throws:
E- if this value is not a byte
-
asReturnedByte
<E extends Exception> byte asReturnedByte(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a byte, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a byte- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a byte; it receives a string clarifying that the method was expected to return a byte while it returned another kind of storage value- Returns:
- the value, as a byte
- Throws:
E- if this value is not a byte
-
asChar
Yields this value as a char, if it is a char.- Type Parameters:
E- the type of the exception thrown if this value is not a char- Parameters:
exception- the supplier of the exception thrown if this value is not a char- Returns:
- the value, as a char
- Throws:
E- if this value is not a char
-
asReturnedChar
<E extends Exception> char asReturnedChar(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a char, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a char- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a char; it receives a string clarifying that the method was expected to return a char while it returned another kind of storage value- Returns:
- the value, as a char
- Throws:
E- if this value is not a char
-
asDouble
Yields this value as a double, if it is a double.- Type Parameters:
E- the type of the exception thrown if this value is not a double- Parameters:
exception- the supplier of the exception thrown if this value is not a double- Returns:
- the value, as a double
- Throws:
E- if this value is not a double
-
asReturnedDouble
<E extends Exception> double asReturnedDouble(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a double, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a double- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a double; it receives a string clarifying that the method was expected to return a double while it returned another kind of storage value- Returns:
- the value, as a double
- Throws:
E- if this value is not a double
-
asFloat
Yields this value as a float, if it is a float.- Type Parameters:
E- the type of the exception thrown if this value is not a float- Parameters:
exception- the supplier of the exception thrown if this value is not a float- Returns:
- the value, as a float
- Throws:
E- if this value is not a float
-
asReturnedFloat
<E extends Exception> float asReturnedFloat(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a float, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a float- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a float; it receives a string clarifying that the method was expected to return a float while it returned another kind of storage value- Returns:
- the value, as a float
- Throws:
E- if this value is not a float
-
asInt
Yields this value as an int, if it is an int.- Type Parameters:
E- the type of the exception thrown if this value is not an int- Parameters:
exception- the supplier of the exception thrown if this value is not an int- Returns:
- the value, as an int
- Throws:
E- if this value is not an int
-
asReturnedInt
<E extends Exception> int asReturnedInt(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as an int, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not an int- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not an int; it receives a string clarifying that the method was expected to return an int while it returned another kind of storage value- Returns:
- the value, as an int
- Throws:
E- if this value is not an int
-
asLong
Yields this value as a long, if it is a long.- Type Parameters:
E- the type of the exception thrown if this value is not a long- Parameters:
exception- the supplier of the exception thrown if this value is not a long- Returns:
- the value, as a long
- Throws:
E- if this value is not a long
-
asReturnedLong
<E extends Exception> long asReturnedLong(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a long, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a long- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a long; it receives a string clarifying that the method was expected to return a long while it returned another kind of storage value- Returns:
- the value, as a long
- Throws:
E- if this value is not a long
-
asShort
Yields this value as a short, if it is a short.- Type Parameters:
E- the type of the exception thrown if this value is not a short- Parameters:
exception- the supplier of the exception thrown if this value is not a short- Returns:
- the value, as a short
- Throws:
E- if this value is not a short
-
asReturnedShort
<E extends Exception> short asReturnedShort(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a short, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a short- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a short; it receives a string clarifying that the method was expected to return a short while it returned another kind of storage value- Returns:
- the value, as a short
- Throws:
E- if this value is not a short
-
asReference
<E extends Exception> StorageReference asReference(Function<StorageValue, ? extends E> exception) throws EYields this value as a reference, if it is a reference.- Type Parameters:
E- the type of the exception thrown if this value is not a reference- Parameters:
exception- the supplier of the exception thrown if this value is not a reference- Returns:
- the value, as a reference
- Throws:
E- if this value is not a reference
-
asReturnedReference
<E extends Exception> StorageReference asReturnedReference(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a reference, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a reference- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a reference; it receives a string clarifying that the method was expected to return a reference while it returned another kind of storage value- Returns:
- the value, as a reference
- Throws:
E- if this value is not a reference
-
asString
Yields this value as a string, if it is a string.- Type Parameters:
E- the type of the exception thrown if this value is not a string- Parameters:
exception- the supplier of the exception thrown if this value is not a string- Returns:
- the value, as a string
- Throws:
E- if this value is not a string
-
asReturnedString
<E extends Exception> String asReturnedString(NonVoidMethodSignature method, Function<String, ? extends E> exception) throws EYields this value as a string, assuming that it is returned by the given method.- Type Parameters:
E- the type of the exception thrown if this value is not a string- Parameters:
method- the called methodexception- the supplier of the exception thrown if this value is not a string; it receives a string clarifying that the method was expected to return a string while it returned another kind of storage value- Returns:
- the value, as a string
- Throws:
E- if this value is not a string
-