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.Option
for 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 class
ValueTypeAssertion.WithValueTypeAssertion<V>
Defines aNamedCollection.Option
for asserting the type of values used with aNamedTopic
.
-
Field Summary
Fields Modifier and Type Field Description static ValueTypeAssertion
WITH_RAW_TYPES
When used warnings will be issued where types are configured but not used.static ValueTypeAssertion
WITHOUT_TYPE_CHECKING
When 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 void
assertTypeSafety(String sName, TopicMapping mapping)
Asserts the type compatibility of a topic given theTopicMapping
that defines the topic.static <V> ValueTypeAssertion<V>
withoutTypeChecking()
Obtains aValueTypeAssertion
that allows topic to be acquired without type-checking, warnings or log messages.static <V> ValueTypeAssertion<V>
withRawTypes()
Obtains aValueTypeAssertion
that allows topic to be acquired and assigned to a rawNamedTopic
reference.static <V> ValueTypeAssertion<V>
withType(Class<V> clsElement)
Obtains aValueTypeAssertion
that 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 theTopicMapping
that defines the topic.- Parameters:
sName
- the name of the topicmapping
- theResourceMapping
- Throws:
IllegalArgumentException
- when type used with theValueTypeAssertion
are illegal according to the configuration
-
withType
static <V> ValueTypeAssertion<V> withType(Class<V> clsElement)
Obtains aValueTypeAssertion
that 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 aValueTypeAssertion
that allows topic to be acquired and assigned to a rawNamedTopic
reference. 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 aValueTypeAssertion
that allows topic to be acquired without type-checking, warnings or log messages.- Returns:
- a
ValueTypeAssertion
-
-