public class CacheKeyBuilder extends Object
Cacheable
objects.
The layout of the serialized cache key is like below.
+--------------------------------------------------------+
| ID (1 byte) |
| type key (1 byte) | serialized value (variable length) |
| type key (1 byte) | serialized value (variable length) |
| ... |
+--------------------------------------------------------+Constructor and Description |
---|
CacheKeyBuilder(byte id) |
Modifier and Type | Method and Description |
---|---|
CacheKeyBuilder |
appendBoolean(boolean input) |
CacheKeyBuilder |
appendByte(byte input) |
CacheKeyBuilder |
appendByteArray(byte[] input) |
CacheKeyBuilder |
appendCacheable(Cacheable input) |
CacheKeyBuilder |
appendCacheables(Collection<? extends Cacheable> input)
Add a collection of Cacheables to the cache key.
|
CacheKeyBuilder |
appendCacheablesIgnoringOrder(Collection<? extends Cacheable> input)
Add a collection of Cacheables to the cache key.
|
CacheKeyBuilder |
appendDouble(double input) |
CacheKeyBuilder |
appendFloat(float input) |
CacheKeyBuilder |
appendFloatArray(float[] input) |
CacheKeyBuilder |
appendInt(int input) |
CacheKeyBuilder |
appendString(String input) |
CacheKeyBuilder |
appendStrings(Collection<String> input)
Add a collection of strings to the cache key.
|
CacheKeyBuilder |
appendStringsIgnoringOrder(Collection<String> input)
Add a collection of strings to the cache key.
|
byte[] |
build() |
public CacheKeyBuilder appendByte(byte input)
public CacheKeyBuilder appendByteArray(byte[] input)
public CacheKeyBuilder appendString(@Nullable String input)
public CacheKeyBuilder appendStrings(Collection<String> input)
input
- a collection of strings to be included in the cache keypublic CacheKeyBuilder appendStringsIgnoringOrder(Collection<String> input)
input
- a collection of strings to be included in the cache keypublic CacheKeyBuilder appendBoolean(boolean input)
public CacheKeyBuilder appendInt(int input)
public CacheKeyBuilder appendFloat(float input)
public CacheKeyBuilder appendDouble(double input)
public CacheKeyBuilder appendFloatArray(float[] input)
public CacheKeyBuilder appendCacheable(@Nullable Cacheable input)
public CacheKeyBuilder appendCacheables(Collection<? extends Cacheable> input)
input
- a collection of Cacheables to be included in the cache keypublic CacheKeyBuilder appendCacheablesIgnoringOrder(Collection<? extends Cacheable> input)
input
- a collection of Cacheables to be included in the cache keypublic byte[] build()
Copyright © 2011–2018. All rights reserved.