public interface ExtendedMessageTypeMapping
Used in «BEP-10: Extension Protocol» for communicating client-specific message type IDs to peers.
All mappings are listed as a set of key-value pairs in a dictionary of supported message types in the extended handshake. In each pair, key is the literal name of a message type, and value is a unique numeric ID, assigned to this message type. Numeric message type IDs are then included in the binary representation of a message and can be used to determine the type of this message.
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.
|
String getTypeNameForId(Integer typeId)
typeId
- Numeric message type IDInteger getIdForTypeName(String typeName)
typeName
- Message type nameString getTypeNameForJavaType(Class<?> type)
type
- Message Java typevoid visitMappings(BiConsumer<String,Integer> visitor)
visitor
- First parameter is message type name,
second parameter is numeric message type ID.Copyright © 2016–2021. All rights reserved.