com.casper.sdk.model.transaction.target.ByHash Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of casper-java-sdk Show documentation
Show all versions of casper-java-sdk Show documentation
SDK to streamline the 3rd party Java client integration processes. Such 3rd parties include exchanges & app developers.
The newest version!
package com.casper.sdk.model.transaction.target;
import com.casper.sdk.exception.NoSuchTypeException;
import com.casper.sdk.model.clvalue.serde.Target;
import com.casper.sdk.model.common.Digest;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonValue;
import dev.oak3.sbs4j.SerializerBuffer;
import dev.oak3.sbs4j.exception.ValueSerializationException;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* The address identifying the invocable entity.
*
* @author [email protected]
*/
@NoArgsConstructor
@AllArgsConstructor
@Setter
@Getter
public class ByHash implements TransactionInvocationTarget {
@JsonValue
private Digest hashAddress;
@JsonCreator
public ByHash(String hashAddress) {
this.hashAddress = new Digest(hashAddress);
}
@Override
public void serialize(final SerializerBuffer ser, final Target target) throws ValueSerializationException, NoSuchTypeException {
ser.writeU8(getByteTag());
ser.writeByteArray(hashAddress.getDigest());
}
@JsonIgnore
@Override
public byte getByteTag() {
return 0;
}
}