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"), 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;
} }
/** /**
@ -63,10 +63,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;
} }
} }