Package com.algorand.algosdk.transaction
Class ResourceRef
- java.lang.Object
-
- com.algorand.algosdk.transaction.ResourceRef
-
public class ResourceRef extends Object
ResourceRef is a reference to a resource in an application call transaction. It can reference different types of resources like accounts, assets, applications, holdings, locals, or boxes. Only one resource type should be set per ResourceRef instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResourceRef.BoxRefBoxRef represents a reference to a box of an application.static classResourceRef.HoldingRefHoldingRef represents a reference to an asset holding of an account.static classResourceRef.LocalsRefLocalsRef represents a reference to the local state of an account for an application.
-
Field Summary
Fields Modifier and Type Field Description AddressaddressLongappLongassetResourceRef.BoxRefboxResourceRef.HoldingRefholdingResourceRef.LocalsReflocals
-
Constructor Summary
Constructors Constructor Description ResourceRef()Default constructor for ResourceRef.ResourceRef(byte[] address, Long asset, Long app, ResourceRef.HoldingRef holding, ResourceRef.LocalsRef locals, ResourceRef.BoxRef box)JsonCreator constructor for ResourceRef deserialization.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static ResourceRefforAddress(Address address)Create a ResourceRef for an account address.static ResourceRefforApp(long appId)Create a ResourceRef for an application.static ResourceRefforAsset(long assetId)Create a ResourceRef for an asset.static ResourceRefforBox(ResourceRef.BoxRef boxRef)Create a ResourceRef for a box reference.static ResourceRefforHolding(ResourceRef.HoldingRef holdingRef)Create a ResourceRef for a holding reference.static ResourceRefforLocals(ResourceRef.LocalsRef localsRef)Create a ResourceRef for a locals reference.inthashCode()booleanisEmpty()Check if this ResourceRef is empty (no resource type is set).StringtoString()voidvalidate()Validate that only one resource type is set.
-
-
-
Field Detail
-
address
public Address address
-
asset
public Long asset
-
app
public Long app
-
holding
public ResourceRef.HoldingRef holding
-
locals
public ResourceRef.LocalsRef locals
-
box
public ResourceRef.BoxRef box
-
-
Constructor Detail
-
ResourceRef
public ResourceRef()
Default constructor for ResourceRef.
-
ResourceRef
public ResourceRef(byte[] address, Long asset, Long app, ResourceRef.HoldingRef holding, ResourceRef.LocalsRef locals, ResourceRef.BoxRef box)JsonCreator constructor for ResourceRef deserialization.
-
-
Method Detail
-
forAddress
public static ResourceRef forAddress(Address address)
Create a ResourceRef for an account address.
-
forAsset
public static ResourceRef forAsset(long assetId)
Create a ResourceRef for an asset.
-
forApp
public static ResourceRef forApp(long appId)
Create a ResourceRef for an application.
-
forHolding
public static ResourceRef forHolding(ResourceRef.HoldingRef holdingRef)
Create a ResourceRef for a holding reference.
-
forLocals
public static ResourceRef forLocals(ResourceRef.LocalsRef localsRef)
Create a ResourceRef for a locals reference.
-
forBox
public static ResourceRef forBox(ResourceRef.BoxRef boxRef)
Create a ResourceRef for a box reference.
-
isEmpty
public boolean isEmpty()
Check if this ResourceRef is empty (no resource type is set).
-
validate
public void validate()
Validate that only one resource type is set.- Throws:
IllegalStateException- if multiple resource types are set
-
-