Reduce ChronicleMapBuilder API surface, hide private API in a class

This commit is contained in:
leventov
2015-08-05 02:57:12 +03:00
parent 8afd90c528
commit 2b6c871562
7 changed files with 168 additions and 70 deletions
@@ -0,0 +1,69 @@
/*
* Copyright (C) 2015 higherfrequencytrading.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.openhft.chronicle.map;
import net.openhft.chronicle.hash.ChronicleHashBuilderPrivateAPI;
import net.openhft.chronicle.hash.serialization.internal.SerializationBuilder;
class ChronicleMapBuilderPrivateAPI<K> implements ChronicleHashBuilderPrivateAPI<K> {
private ChronicleMapBuilder<K, ?> b;
public ChronicleMapBuilderPrivateAPI(ChronicleMapBuilder<K, ?> b) {
this.b = b;
}
@Override
public SerializationBuilder<K> keyBuilder() {
return b.keyBuilder();
}
@Override
public int segmentEntrySpaceInnerOffset(boolean replicated) {
return b.segmentEntrySpaceInnerOffset(replicated);
}
@Override
public long chunkSize(boolean replicated) {
return b.chunkSize(replicated);
}
@Override
public int maxChunksPerEntry(boolean replicated) {
return b.maxChunksPerEntry(replicated);
}
@Override
public long entriesPerSegment(boolean replicated) {
return b.entriesPerSegment(replicated);
}
@Override
public long actualChunksPerSegment(boolean replicated) {
return b.actualChunksPerSegment(replicated);
}
@Override
public int segmentHeaderSize(boolean replicated) {
return b.segmentHeaderSize(replicated);
}
@Override
public int actualSegments(boolean replicated) {
return b.actualSegments(replicated);
}
}