@Test public void testValueSerializer() throws Exception { OHCacheBuilder<String, String> builder = OHCacheBuilder.newBuilder(); Assert.assertNull(builder.getValueSerializer()); CacheSerializer<String> inst = new CacheSerializer<String>() { public void serialize(String s, ByteBuffer out) { } public String deserialize(ByteBuffer in) { return null; } public int serializedSize(String s) { return 0; } }; builder.valueSerializer(inst); Assert.assertSame(builder.getValueSerializer(), inst); }
public OHCacheBuilder<K, V> valueSerializer(CacheSerializer<V> valueSerializer) { this.valueSerializer = valueSerializer; return this; }
OHCacheBuilder { public OHCacheBuilder<K, V> valueSerializer(CacheSerializer<V> valueSerializer) { this.valueSerializer = valueSerializer; return this; } }
OHCacheBuilder { public OHCacheBuilder<K, V> valueSerializer(CacheSerializer<V> valueSerializer) { this.valueSerializer = valueSerializer; return this; } private  OHCacheBuilder(); }
OHCacheBuilder { public OHCacheBuilder<K, V> valueSerializer(CacheSerializer<V> valueSerializer) { this.valueSerializer = valueSerializer; return this; } private  OHCacheBuilder(); static OHCacheBuilder<K, V> newBuilder(); OHCache<K, V> build(); int getHashTableSize(); OHCacheBuilder<K, V> hashTableSize(int hashTableSize); int getChunkSize(); OHCacheBuilder<K, V> chunkSize(int chunkSize); long getCapacity(); OHCacheBuilder<K, V> capacity(long capacity); CacheSerializer<K> getKeySerializer(); OHCacheBuilder<K, V> keySerializer(CacheSerializer<K> keySerializer); CacheSerializer<V> getValueSerializer(); OHCacheBuilder<K, V> valueSerializer(CacheSerializer<V> valueSerializer); int getSegmentCount(); OHCacheBuilder<K, V> segmentCount(int segmentCount); float getLoadFactor(); OHCacheBuilder<K, V> loadFactor(float loadFactor); long getMaxEntrySize(); OHCacheBuilder<K, V> maxEntrySize(long maxEntrySize); int getFixedKeySize(); int getFixedValueSize(); OHCacheBuilder<K, V> fixedEntrySize(int fixedKeySize, int fixedValueSize); ScheduledExecutorService getExecutorService(); OHCacheBuilder<K, V> executorService(ScheduledExecutorService executorService); HashAlgorithm getHashAlgorighm(); OHCacheBuilder<K, V> hashMode(HashAlgorithm hashMode); boolean isThrowOOME(); OHCacheBuilder<K, V> throwOOME(boolean throwOOME); boolean isUnlocked(); OHCacheBuilder<K, V> unlocked(boolean unlocked); long getDefaultTTLmillis(); OHCacheBuilder<K, V> defaultTTLmillis(long defaultTTLmillis); boolean isTimeouts(); OHCacheBuilder<K, V> timeouts(boolean timeouts); int getTimeoutsSlots(); OHCacheBuilder<K, V> timeoutsSlots(int timeoutsSlots); int getTimeoutsPrecision(); OHCacheBuilder<K, V> timeoutsPrecision(int timeoutsPrecision); Ticker getTicker(); OHCacheBuilder<K, V> ticker(Ticker ticker); Eviction getEviction(); OHCacheBuilder<K, V> eviction(Eviction eviction); int getFrequencySketchSize(); OHCacheBuilder<K, V> frequencySketchSize(int frequencySketchSize); double getEdenSize(); OHCacheBuilder<K, V> edenSize(double edenSize); }
OHCacheBuilder { public OHCacheBuilder<K, V> valueSerializer(CacheSerializer<V> valueSerializer) { this.valueSerializer = valueSerializer; return this; } private  OHCacheBuilder(); static OHCacheBuilder<K, V> newBuilder(); OHCache<K, V> build(); int getHashTableSize(); OHCacheBuilder<K, V> hashTableSize(int hashTableSize); int getChunkSize(); OHCacheBuilder<K, V> chunkSize(int chunkSize); long getCapacity(); OHCacheBuilder<K, V> capacity(long capacity); CacheSerializer<K> getKeySerializer(); OHCacheBuilder<K, V> keySerializer(CacheSerializer<K> keySerializer); CacheSerializer<V> getValueSerializer(); OHCacheBuilder<K, V> valueSerializer(CacheSerializer<V> valueSerializer); int getSegmentCount(); OHCacheBuilder<K, V> segmentCount(int segmentCount); float getLoadFactor(); OHCacheBuilder<K, V> loadFactor(float loadFactor); long getMaxEntrySize(); OHCacheBuilder<K, V> maxEntrySize(long maxEntrySize); int getFixedKeySize(); int getFixedValueSize(); OHCacheBuilder<K, V> fixedEntrySize(int fixedKeySize, int fixedValueSize); ScheduledExecutorService getExecutorService(); OHCacheBuilder<K, V> executorService(ScheduledExecutorService executorService); HashAlgorithm getHashAlgorighm(); OHCacheBuilder<K, V> hashMode(HashAlgorithm hashMode); boolean isThrowOOME(); OHCacheBuilder<K, V> throwOOME(boolean throwOOME); boolean isUnlocked(); OHCacheBuilder<K, V> unlocked(boolean unlocked); long getDefaultTTLmillis(); OHCacheBuilder<K, V> defaultTTLmillis(long defaultTTLmillis); boolean isTimeouts(); OHCacheBuilder<K, V> timeouts(boolean timeouts); int getTimeoutsSlots(); OHCacheBuilder<K, V> timeoutsSlots(int timeoutsSlots); int getTimeoutsPrecision(); OHCacheBuilder<K, V> timeoutsPrecision(int timeoutsPrecision); Ticker getTicker(); OHCacheBuilder<K, V> ticker(Ticker ticker); Eviction getEviction(); OHCacheBuilder<K, V> eviction(Eviction eviction); int getFrequencySketchSize(); OHCacheBuilder<K, V> frequencySketchSize(int frequencySketchSize); double getEdenSize(); OHCacheBuilder<K, V> edenSize(double edenSize); static final String SYSTEM_PROPERTY_PREFIX; }