<commit_before>/*
 * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

package org.opendaylight.controller.cluster.raft;

import java.io.Serializable;
import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload;

public class ReplicatedLogImplEntry implements ReplicatedLogEntry, Serializable {
    private static final long serialVersionUID = -9085798014576489130L;

    private final long index;
    private final long term;
    private final Payload payload;

    public ReplicatedLogImplEntry(long index, long term, Payload payload) {

        this.index = index;
        this.term = term;
        this.payload = payload;
    }

    @Override
    public Payload getData() {
        return payload;
    }

    @Override
    public long getTerm() {
        return term;
    }

    @Override
    public long getIndex() {
        return index;
    }

    @Override
    public int size() {
        return getData().size();
    }

    @Override
    public String toString() {
        return "Entry{" +
            "index=" + index +
            ", term=" + term +
            '}';
    }
}
<commit_msg>Make ReplicatedLogImplEntry final<commit_after>/*
 * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

package org.opendaylight.controller.cluster.raft;

import com.google.common.base.Preconditions;
import java.io.Serializable;
import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload;

/**
 * A {@link ReplicatedLogEntry} implementation.
 */
public final class ReplicatedLogImplEntry implements ReplicatedLogEntry, Serializable {
    private static final long serialVersionUID = -9085798014576489130L;

    private final long index;
    private final long term;
    private final Payload payload;

    public ReplicatedLogImplEntry(final long index, final long term, final Payload payload) {
        this.index = index;
        this.term = term;
        this.payload = Preconditions.checkNotNull(payload);
    }

    @Override
    public Payload getData() {
        return payload;
    }

    @Override
    public long getTerm() {
        return term;
    }

    @Override
    public long getIndex() {
        return index;
    }

    @Override
    public int size() {
        return getData().size();
    }

    @Override
    public String toString() {
        return "Entry{index=" + index + ", term=" + term + '}';
    }
}

{'fraction_non_alphanumeric': 0.09065647794373047, 'fraction_numerical': 0.0187565126780132, 'mean_word_length': 2.8348868175765647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2899295', 'n_tokens_mistral': 835, 'n_tokens_neox': 784, 'n_words': 243}