
package com.hazelcast.simulator.hz;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;

public class ExternalizablePojo implements Externalizable {
    private int id;

    public ExternalizablePojo() {
        // No-op.
    }

    public ExternalizablePojo(int id) {
        this.id = id;
    }

    public int id() {
        return id;
    }

    @Override
    public void readExternal(ObjectInput in) throws IOException {
        id = in.readInt();
    }

    @Override
    public void writeExternal(ObjectOutput out) throws IOException {
        out.writeInt(id);
    }

    @Override
    public String toString() {
        return "ExternalizablePojo{id=" + id + '}';
    }
}
