Cleanup and remove get prefix of method to be more inline with our API
This commit is contained in:
parent
7324ce6fde
commit
4ee81d9235
@ -44,14 +44,14 @@ public abstract class SpdyOrHttpChooser extends ByteToMessageDecoder {
|
|||||||
HTTP_1_0("http/1.0"),
|
HTTP_1_0("http/1.0"),
|
||||||
UNKNOWN("Unknown");
|
UNKNOWN("Unknown");
|
||||||
|
|
||||||
private String name;
|
private final String name;
|
||||||
|
|
||||||
private SelectedProtocol(String defaultName) {
|
SelectedProtocol(String defaultName) {
|
||||||
this.name = defaultName;
|
name = defaultName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String protocolName() {
|
||||||
return this.name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,10 +61,9 @@ public abstract class SpdyOrHttpChooser extends ByteToMessageDecoder {
|
|||||||
* the protocol name
|
* the protocol name
|
||||||
* @return the SelectedProtocol instance
|
* @return the SelectedProtocol instance
|
||||||
*/
|
*/
|
||||||
public static SelectedProtocol getProtocolByName(String name) {
|
public static SelectedProtocol protocol(String name) {
|
||||||
|
|
||||||
for (SelectedProtocol protocol : SelectedProtocol.values()) {
|
for (SelectedProtocol protocol : SelectedProtocol.values()) {
|
||||||
if (protocol.getName().equals(name)) {
|
if (protocol.protocolName().equals(name)) {
|
||||||
return protocol;
|
return protocol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user