T
- a type that represents the asset in question. This should describe the basic type of the asset (GBP, USD, oil, shares in company , etc.) and any additional metadata (issuer, grade, class, etc.).
public FungibleAsset<T> extends FungibleState<T>, OwnableState
Interface for contract states representing assets which are fungible, countable and issued by a specific party. States contain assets which are equivalent (such as cash of the same currency), so records of their existence can be merged or split as needed where the issuer is the same. For instance, dollars issued by the Fed are fungible and countable (in cents), barrels of West Texas crude are fungible and countable (oil from two small containers can be poured into one large container), shares of the same class in a specific company are fungible and countable, and so on.
An example usage would be a cash transaction contract that implements currency using state objects that implement this interface.
@NotNull Amount<net.corda.core.contracts.Issued> getAmount()
Amount represents a positive quantity of some issued product which can be cash, tokens, assets, or generally
anything else that's quantifiable with integer quantities. See class Issued
and class Amount
for more details.
class Issued
,
class Amount
@NotNull java.util.Collection<java.security.PublicKey> getExitKeys()
There must be an ExitCommand signed by these keys to destroy the amount. While all states require their owner to sign, some (i.e. cash) also require the issuer.
@NotNull FungibleAsset<T> withNewOwnerAndAmount(@NotNull Amount<net.corda.core.contracts.Issued> newAmount, @NotNull AbstractParty newOwner)
Copies the underlying data structure, replacing the amount and owner fields with the new values and leaving the rest (exitKeys) alone.