Enum NoOpCache
- java.lang.Object
-
- java.lang.Enum<NoOpCache>
-
- io.fluxcapacitor.javaclient.persisting.caching.NoOpCache
-
- All Implemented Interfaces:
Cache,Serializable,Comparable<NoOpCache>
public enum NoOpCache extends Enum<NoOpCache> implements Cache
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tget(String id, Function<? super String,T> mappingFunction)Returns the value associated with the given id.<T> TgetIfPresent(String id)Returns the value associated with the given id if it exists in the cache.voidinvalidate(String id)Invalidates the cache entry mapped to given id.voidinvalidateAll()Invalidates all cache entries.voidput(String id, Object value)Adds or replaces a value in the cache.static NoOpCachevalueOf(String name)Returns the enum constant of this type with the specified name.static NoOpCache[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final NoOpCache INSTANCE
-
-
Method Detail
-
values
public static NoOpCache[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NoOpCache c : NoOpCache.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NoOpCache valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
put
public void put(String id, Object value)
Description copied from interface:CacheAdds or replaces a value in the cache.
-
get
public <T> T get(String id, Function<? super String,T> mappingFunction)
Description copied from interface:CacheReturns the value associated with the given id. If there is no association, the mapping function is used to calculate a value. This value will be stored in the cache.
-
getIfPresent
public <T> T getIfPresent(String id)
Description copied from interface:CacheReturns the value associated with the given id if it exists in the cache. If there is no association,nullis returned.- Specified by:
getIfPresentin interfaceCache- Type Parameters:
T- the type of object to return from the cache- Parameters:
id- The object id- Returns:
- The value associated with given id
-
invalidate
public void invalidate(String id)
Description copied from interface:CacheInvalidates the cache entry mapped to given id.- Specified by:
invalidatein interfaceCache
-
invalidateAll
public void invalidateAll()
Description copied from interface:CacheInvalidates all cache entries.- Specified by:
invalidateAllin interfaceCache
-
-