Package com.tangosol.net
Interface ValueTypeAssertion<V>
-
- Type Parameters:
V- the type of the topic values
- All Superinterfaces:
NamedCollection.Option
- All Known Implementing Classes:
ValueTypeAssertion.WithValueTypeAssertion
public interface ValueTypeAssertion<V> extends NamedCollection.Option
Defines aNamedCollection.Optionfor asserting the type of values used with aNamedTopic.- Since:
- Coherence 14.1.1
- Author:
- jk 2015.09.15
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classValueTypeAssertion.WithValueTypeAssertion<V>Defines aNamedCollection.Optionfor asserting the type of values used with aNamedTopic.
-
Field Summary
Fields Modifier and Type Field Description static ValueTypeAssertionWITH_RAW_TYPESWhen used warnings will be issued where types are configured but not used.static ValueTypeAssertionWITHOUT_TYPE_CHECKINGWhen used no type checking will occur and no warnings will be generated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidassertTypeSafety(String sName, TopicMapping mapping)Asserts the type compatibility of a topic given theTopicMappingthat defines the topic.static <V> ValueTypeAssertion<V>withoutTypeChecking()Obtains aValueTypeAssertionthat allows topic to be acquired without type-checking, warnings or log messages.static <V> ValueTypeAssertion<V>withRawTypes()Obtains aValueTypeAssertionthat allows topic to be acquired and assigned to a rawNamedTopicreference.static <V> ValueTypeAssertion<V>withType(Class<V> clsElement)Obtains aValueTypeAssertionthat asserts the specified types are configured for a topic.
-
-
-
Field Detail
-
WITHOUT_TYPE_CHECKING
static final ValueTypeAssertion WITHOUT_TYPE_CHECKING
When used no type checking will occur and no warnings will be generated.
-
WITH_RAW_TYPES
static final ValueTypeAssertion WITH_RAW_TYPES
When used warnings will be issued where types are configured but not used.
-
-
Method Detail
-
assertTypeSafety
void assertTypeSafety(String sName, TopicMapping mapping) throws IllegalArgumentException
Asserts the type compatibility of a topic given theTopicMappingthat defines the topic.- Parameters:
sName- the name of the topicmapping- theResourceMapping- Throws:
IllegalArgumentException- when type used with theValueTypeAssertionare illegal according to the configuration
-
withType
static <V> ValueTypeAssertion<V> withType(Class<V> clsElement)
Obtains aValueTypeAssertionthat asserts the specified types are configured for a topic.- Parameters:
clsElement- the desired type of the elements within the topic- Returns:
- a
ValueTypeAssertion
-
withRawTypes
@Default static <V> ValueTypeAssertion<V> withRawTypes()
Obtains aValueTypeAssertionthat allows topic to be acquired and assigned to a rawNamedTopicreference. A debug log message will be raised for topics that have been configured with specific types.- Returns:
- a
ValueTypeAssertion
-
withoutTypeChecking
static <V> ValueTypeAssertion<V> withoutTypeChecking()
Obtains aValueTypeAssertionthat allows topic to be acquired without type-checking, warnings or log messages.- Returns:
- a
ValueTypeAssertion
-
-