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

org.jsimpledb.kv.raft.PrefixAdjustFunction Maven / Gradle / Ivy


/*
 * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
 */

package org.jsimpledb.kv.raft;

import com.google.common.primitives.Bytes;

import java.util.AbstractMap;
import java.util.Map;

class PrefixAdjustFunction extends AbstractPrefixFunction, Map.Entry> {

    PrefixAdjustFunction(byte[] prefix) {
        super(prefix);
    }

    @Override
    public Map.Entry apply(Map.Entry entry) {
        return new AbstractMap.SimpleEntry(Bytes.concat(this.prefix, entry.getKey()), entry.getValue());
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy