Cleanup and remove get prefix of method to be more inline with our API

This commit is contained in:
Norman Maurer 2014-01-11 14:19:43 +01:00
parent 3ce35c710a
commit eca5613534

View File

@ -46,14 +46,14 @@ public abstract class SpdyOrHttpChooser extends ByteToMessageDecoder {
HTTP_1_0("http/1.0"),
UNKNOWN("Unknown");
private String name;
private final String name;
private SelectedProtocol(String defaultName) {
this.name = defaultName;
SelectedProtocol(String defaultName) {
name = defaultName;
}
public String getName() {
return this.name;
public String protocolName() {
return name;
}
/**
@ -63,10 +63,9 @@ public abstract class SpdyOrHttpChooser extends ByteToMessageDecoder {
* the protocol name
* @return the SelectedProtocol instance
*/
public static SelectedProtocol getProtocolByName(String name) {
public static SelectedProtocol protocol(String name) {
for (SelectedProtocol protocol : SelectedProtocol.values()) {
if (protocol.getName().equals(name)) {
if (protocol.protocolName().equals(name)) {
return protocol;
}
}