public class AlphaSortedMapping extends Object implements ExtendedMessageTypeMapping
Note that this class implements a service. Hence, is not a part of the public API and is a subject to change.
Constructor and Description |
---|
AlphaSortedMapping(Map<String,MessageHandler<? extends ExtendedMessage>> handlersByTypeName) |
Modifier and Type | Method and Description |
---|---|
Integer |
getIdForTypeName(String typeName)
Get numeric ID for a message type with a given literal name.
|
String |
getTypeNameForId(Integer typeId)
Get literal name of a message type with a given numeric ID.
|
String |
getTypeNameForJavaType(Class<?> type)
Get literal name for a message type.
|
void |
visitMappings(BiConsumer<String,Integer> visitor)
Visitor interface for all mappings, contained in this set.
|
public AlphaSortedMapping(Map<String,MessageHandler<? extends ExtendedMessage>> handlersByTypeName)
public String getTypeNameForId(Integer typeId)
ExtendedMessageTypeMapping
getTypeNameForId
in interface ExtendedMessageTypeMapping
typeId
- Numeric message type IDpublic Integer getIdForTypeName(String typeName)
ExtendedMessageTypeMapping
getIdForTypeName
in interface ExtendedMessageTypeMapping
typeName
- Message type namepublic String getTypeNameForJavaType(Class<?> type)
ExtendedMessageTypeMapping
getTypeNameForJavaType
in interface ExtendedMessageTypeMapping
type
- Message Java typepublic void visitMappings(BiConsumer<String,Integer> visitor)
ExtendedMessageTypeMapping
visitMappings
in interface ExtendedMessageTypeMapping
visitor
- First parameter is message type name,
second parameter is numeric message type ID.Copyright © 2016–2021. All rights reserved.