CLValueI32.java
package com.syntifi.casper.sdk.model.clvalue;
import java.io.IOException;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.syntifi.casper.sdk.annotation.ExcludeFromJacocoGeneratedReport;
import com.syntifi.casper.sdk.exception.CLValueDecodeException;
import com.syntifi.casper.sdk.model.clvalue.cltype.CLTypeI32;
import com.syntifi.casper.sdk.model.clvalue.encdec.CLValueDecoder;
import com.syntifi.casper.sdk.model.clvalue.encdec.CLValueEncoder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* Casper I32 CLValue implementation
*
* @author Alexandre Carvalho
* @author Andre Bertolace
* @see AbstractCLValue
* @since 0.0.1
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class CLValueI32 extends AbstractCLValue<Integer, CLTypeI32> {
private CLTypeI32 clType = new CLTypeI32();
@JsonSetter("cl_type")
@ExcludeFromJacocoGeneratedReport
protected void setJsonClType(CLTypeI32 clType) {
this.clType = clType;
}
@JsonGetter("cl_type")
@ExcludeFromJacocoGeneratedReport
protected String getJsonClType() {
return this.getClType().getTypeName();
}
public CLValueI32(Integer value) {
this.setValue(value);
}
@Override
public void encode(CLValueEncoder clve) throws IOException {
clve.writeI32(this);
}
@Override
public void decode(CLValueDecoder clvd) throws IOException, CLValueDecodeException {
clvd.readI32(this);
}
}