Package com.tangosol.net.cache
Interface TypeAssertion<K,V> 
- Type Parameters:
 K- the type of the cache entry keysV- the type of the cache entry values
- All Superinterfaces:
 NamedMap.Option
- All Known Implementing Classes:
 TypeAssertion.WithTypesAssertion
Defines a 
NamedMap.Option for asserting the type
 of keys and values used with a NamedCache.- Since:
 - Coherence 12.2.1
 - Author:
 - bko 2015.06.15
 
- 
Nested Class Summary
Nested Classes - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeAssertionWhen used warnings will be issued where types are configured but not used.static final TypeAssertionWhen used no type checking will occur and no warnings will be generated. - 
Method Summary
Modifier and TypeMethodDescriptiondefault booleanassertTypeSafety(String sCacheName, CacheMapping cacheMapping) Asserts the type compatibility of a named cache given theCacheMappingthat defines the cache.booleanassertTypeSafety(String sCacheName, CacheMapping cacheMapping, boolean fLog) Asserts the type compatibility of a named cache given theCacheMappingthat defines the cache.static <K,V> TypeAssertion <K, V> Obtains aTypeAssertionthat allows NamedCaches to be acquired without type-checking, warnings or log messages.static TypeAssertionObtains aTypeAssertionthat allows NamedCaches to be acquired and assigned to a raw NamedCache reference.static <K,V> TypeAssertion <K, V> Obtains aTypeAssertionthat asserts the specified types are configured for a cache. 
- 
Field Details
- 
WITHOUT_TYPE_CHECKING
When used no type checking will occur and no warnings will be generated. - 
WITH_RAW_TYPES
When used warnings will be issued where types are configured but not used. 
 - 
 - 
Method Details
- 
assertTypeSafety
boolean assertTypeSafety(String sCacheName, CacheMapping cacheMapping, boolean fLog) throws IllegalArgumentException Asserts the type compatibility of a named cache given theCacheMappingthat defines the cache.- Parameters:
 sCacheName- the name of the cachecacheMapping- theCacheMappingfLog- when true, log warning if typing mismatch betweenCacheMappingconfiguration and thisTypeAssertion; specifically, one uses raw types and the other asserts specific types.- Returns:
 - false if warning logged about the assertion, true otherwise.
 - Throws:
 IllegalArgumentException- when types used with theTypeAssertionare illegal according to the configuration
 - 
assertTypeSafety
default boolean assertTypeSafety(String sCacheName, CacheMapping cacheMapping) throws IllegalArgumentException Asserts the type compatibility of a named cache given theCacheMappingthat defines the cache.- Parameters:
 sCacheName- the name of the cachecacheMapping- theCacheMapping- Returns:
 - false if warning logged about the assertion, true otherwise.
 - Throws:
 IllegalArgumentException- when types used with theTypeAssertionare illegal according to the configuration
 - 
withTypes
Obtains aTypeAssertionthat asserts the specified types are configured for a cache.- Type Parameters:
 K- the key typeV- the value type- Parameters:
 clsKey- the desired key typeclsValue- the desired value type- Returns:
 - a 
TypeAssertion 
 - 
withRawTypes
Obtains aTypeAssertionthat allows NamedCaches to be acquired and assigned to a raw NamedCache reference. A debug log message will be raised for caches that have been configured with specific types.- Returns:
 - a 
TypeAssertion 
 - 
withoutTypeChecking
Obtains aTypeAssertionthat allows NamedCaches to be acquired without type-checking, warnings or log messages.- Type Parameters:
 K- the key typeV- the value type- Returns:
 - a 
TypeAssertion 
 
 -