@Test public void convertFromNull() throws Exception { expectedException.expect(ParameterException.class); expectedException.expectMessage("Couldn't convert empty string to \"HTTP\" or \"TELNET\"."); new OpenTsdbProtocolConverter().convertFrom(null); }
@Override public OpenTsdbProtocol convertFrom(String value) { if (Strings.isNullOrEmpty(value)) { throw new ParameterException("Couldn't convert empty string to \"HTTP\" or \"TELNET\"."); } try { return OpenTsdbProtocol.valueOf(value.toUpperCase(Locale.ENGLISH)); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } }
OpenTsdbProtocolConverter implements Converter<OpenTsdbProtocol> { @Override public OpenTsdbProtocol convertFrom(String value) { if (Strings.isNullOrEmpty(value)) { throw new ParameterException("Couldn't convert empty string to \"HTTP\" or \"TELNET\"."); } try { return OpenTsdbProtocol.valueOf(value.toUpperCase(Locale.ENGLISH)); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } } }
OpenTsdbProtocolConverter implements Converter<OpenTsdbProtocol> { @Override public OpenTsdbProtocol convertFrom(String value) { if (Strings.isNullOrEmpty(value)) { throw new ParameterException("Couldn't convert empty string to \"HTTP\" or \"TELNET\"."); } try { return OpenTsdbProtocol.valueOf(value.toUpperCase(Locale.ENGLISH)); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } }  }
OpenTsdbProtocolConverter implements Converter<OpenTsdbProtocol> { @Override public OpenTsdbProtocol convertFrom(String value) { if (Strings.isNullOrEmpty(value)) { throw new ParameterException("Couldn't convert empty string to \"HTTP\" or \"TELNET\"."); } try { return OpenTsdbProtocol.valueOf(value.toUpperCase(Locale.ENGLISH)); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } }  @Override OpenTsdbProtocol convertFrom(String value); @Override String convertTo(OpenTsdbProtocol value); }
OpenTsdbProtocolConverter implements Converter<OpenTsdbProtocol> { @Override public OpenTsdbProtocol convertFrom(String value) { if (Strings.isNullOrEmpty(value)) { throw new ParameterException("Couldn't convert empty string to \"HTTP\" or \"TELNET\"."); } try { return OpenTsdbProtocol.valueOf(value.toUpperCase(Locale.ENGLISH)); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } }  @Override OpenTsdbProtocol convertFrom(String value); @Override String convertTo(OpenTsdbProtocol value);  }