class PreVoteRequest extends TransportRequest {

    private final DiscoveryNode sourceNode;
    private final long currentTerm;

    public PreVoteRequest(DiscoveryNode sourceNode, long currentTerm) {
        this.sourceNode = sourceNode;
        this.currentTerm = currentTerm;
    }

    public PreVoteRequest(StreamInput in) throws IOException {
        super(in);
        sourceNode = new DiscoveryNode(in);
        currentTerm = in.readLong();
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        super.writeTo(out);
        sourceNode.writeTo(out);
        out.writeLong(currentTerm);
    }

    public DiscoveryNode getSourceNode() {
        return sourceNode;
    }

    public long getCurrentTerm() {
        return currentTerm;
    }

    @Override
    public String toString() {
        return "PreVoteRequest{" +
            "sourceNode=" + sourceNode +
            ", currentTerm=" + currentTerm +
            '}';
    }

    @Override
    public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

    @Override
    public int hashCode() {
        return Objects.hash(sourceNode, currentTerm);
    }
}

        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PreVoteRequest that = (PreVoteRequest) o;
        return currentTerm == that.currentTerm &&
            Objects.equals(sourceNode, that.sourceNode);
    
<methods>public void <init>() ,public void <init>(org.elasticsearch.common.io.stream.StreamInput) throws java.io.IOException,public org.elasticsearch.tasks.TaskId getParentTask() ,public void setParentTask(org.elasticsearch.tasks.TaskId) ,public void writeTo(org.elasticsearch.common.io.stream.StreamOutput) throws java.io.IOException<variables>private org.elasticsearch.tasks.TaskId parentTaskId