- java.lang.Object
-
- org.praxislive.core.Protocol.Type<T>
-
- Type Parameters:
T
- class of protocol
- Enclosing interface:
- Protocol
public static class Protocol.Type<T extends Protocol> extends Object
A protocol type registration, allowing protocols to be discovered by class or name. Additional types may be registered usingProtocol.TypeProvider
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<T>
asClass()
Access the class of the Protocol type.boolean
equals(Object obj)
static Optional<Protocol.Type<? extends Protocol>>
fromName(String name)
Lookup the Protocol type by name.int
hashCode()
String
name()
Access the name of the Protocol type.static <T extends Protocol>
Protocol.Type<T>of(Class<T> cls)
Lookup the Protocol type of the provided class.String
toString()
-
-
-
Method Detail
-
name
public String name()
Access the name of the Protocol type.- Returns:
- name
-
of
public static <T extends Protocol> Protocol.Type<T> of(Class<T> cls)
Lookup the Protocol type of the provided class. The type must be registered.- Type Parameters:
T
- class type- Parameters:
cls
- class- Returns:
- type
-
fromName
public static Optional<Protocol.Type<? extends Protocol>> fromName(String name)
Lookup the Protocol type by name. If not registered an empty optional is returned.- Parameters:
name
- protocol name- Returns:
- optional of type
-
-