All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.casper.sdk.model.transaction.target.Stored Maven / Gradle / Ivy

Go to download

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.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import dev.oak3.sbs4j.SerializerBuffer;
import dev.oak3.sbs4j.exception.ValueSerializationException;
import lombok.*;

/**
 * The execution target is a stored entity or package.
 *
 * @author [email protected]
 */
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Builder
@JsonTypeName("Stored")
public class Stored implements TransactionTarget {
    /** The identifier of the stored execution target. */
    private TransactionInvocationTarget id;

    /** The execution runtime to use. */
    @JsonProperty("runtime")
    private TransactionRuntime runtime;

    @Override
    public void serialize(final SerializerBuffer ser, final Target target) throws ValueSerializationException, NoSuchTypeException {
        ser.writeU8(getByteTag());
        id.serialize(ser, target);
        ser.writeU8(runtime.getByteTag());
    }

    @Override
    @JsonIgnore
    public byte getByteTag() {
        return 1;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy