java.lang.Object
org.praxislive.core.Protocol.Type<T>
- Type Parameters:
T- class of protocol
- Enclosing interface:
Protocol
A protocol type registration, allowing protocols to be discovered by
class or name. Additional types may be registered using
Protocol.TypeProvider.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasClass()Access the class of the Protocol type.booleanstatic Optional<Protocol.Type<? extends Protocol>> Lookup the Protocol type by name.inthashCode()name()Access the name of the Protocol type.static <T extends Protocol>
Protocol.Type<T> Lookup the Protocol type of the provided class.toString()
-
Constructor Details
-
Type
Construct a type for the given Protocol class. The name will be the simple name of the class.- Parameters:
cls- Protocol class
-
-
Method Details
-
asClass
Access the class of the Protocol type.- Returns:
- class
-
name
Access the name of the Protocol type.- Returns:
- name
-
toString
-
hashCode
public int hashCode() -
equals
-
of
Lookup the Protocol type of the provided class. The type must be registered.- Type Parameters:
T- class type- Parameters:
cls- class- Returns:
- type
-
fromName
Lookup the Protocol type by name. If not registered an empty optional is returned.- Parameters:
name- protocol name- Returns:
- optional of type
-