Package convex.core.data
Class AObject
java.lang.Object
convex.core.data.AObject
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
attachEncoding
(Blob data) Attach the given encoded Blob to this object Warning: Blob must be the correct canonical representation of this Cell, otherwise bad things may happen (incorrect hashcode, etc.)protected abstract Blob
Creates a Blob object representing this object.Gets the encoded byte representation of this cell.final AString
print()
Prints this Object as a CVM String value, for human consumption.final AString
print
(long limit) Prints this Object as a CVM String value, for human consumption.abstract boolean
print
(BlobBuilder sb, long limit) Prints this Object to a readable String Representation.
-
Field Details
-
encoding
We cache the Blob for the binary encoding of this Cell
-
-
Constructor Details
-
AObject
public AObject()
-
-
Method Details
-
print
Prints this Object to a readable String Representation. SECURITY: Must halt and return false in O(1) time when limit of printing is exceeded otherwise DoS attacks may be possible.- Parameters:
sb
- BlobBuilder to append to. May be partially written if print limit exceededlimit
- Limit of printing in string bytes- Returns:
- True if fully printed within limit, false otherwise
-
print
Prints this Object as a CVM String value, for human consumption. May include readable message indicating failure if print limit exceeded.- Returns:
- String representation
-
print
Prints this Object as a CVM String value, for human consumption. May include readable message indicating failure if print limit exceeded.- Parameters:
limit
- Limit of bytes to print- Returns:
- String representation
-
getEncoding
Gets the encoded byte representation of this cell.- Returns:
- A blob representing this cell in encoded form
-
createEncoding
Creates a Blob object representing this object. Should be called only after the cached encoding has been checked.- Returns:
- Blob Encoding of Object
-
attachEncoding
Attach the given encoded Blob to this object Warning: Blob must be the correct canonical representation of this Cell, otherwise bad things may happen (incorrect hashcode, etc.)- Parameters:
data
- Encoding of Value. Must be a correct canonical encoding, or null to clear the cached encoding
-