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 class
ResourceRef.BoxRef
BoxRef represents a reference to a box of an application.static class
ResourceRef.HoldingRef
HoldingRef represents a reference to an asset holding of an account.static class
ResourceRef.LocalsRef
LocalsRef represents a reference to the local state of an account for an application.
-
Field Summary
Fields Modifier and Type Field Description Address
address
Long
app
Long
asset
ResourceRef.BoxRef
box
ResourceRef.HoldingRef
holding
ResourceRef.LocalsRef
locals
-
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 boolean
equals(Object o)
static ResourceRef
forAddress(Address address)
Create a ResourceRef for an account address.static ResourceRef
forApp(long appId)
Create a ResourceRef for an application.static ResourceRef
forAsset(long assetId)
Create a ResourceRef for an asset.static ResourceRef
forBox(ResourceRef.BoxRef boxRef)
Create a ResourceRef for a box reference.static ResourceRef
forHolding(ResourceRef.HoldingRef holdingRef)
Create a ResourceRef for a holding reference.static ResourceRef
forLocals(ResourceRef.LocalsRef localsRef)
Create a ResourceRef for a locals reference.int
hashCode()
boolean
isEmpty()
Check if this ResourceRef is empty (no resource type is set).String
toString()
void
validate()
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
-
-