- 可以

import org.web3j.abi.datatypes.Uint64;
import org.web3j.abi.datatypes.generated.Uint64;
import org.web3j.abi.datatypes.DynamicStruct;
import org.web3j.protocol.core.methods.response.EthCall;
import java.util.Arrays;
public class Demo extends DynamicStruct {
public Uint64 uid;
public Uint64 amount;
public Demo(Uint64 uid, Uint64 amount) {
super(uid, amount);
this.uid = uid;
this.amount = amount;
}
public Demo(long uid, long amount) {
this(new Uint64(uid), new Uint64(amount));
}
}
Function function = new Function(
"send",
Arrays.asList(new Demo(new Uint64(1), new Uint64(2))),
Collections.emptyList()
);
2.重写toString方法

@Override
public String toString() {
return "{" +
"\"uid\":" + uid.getValue() +
", \"amount\":" + amount.getValue() +
'}';
}