@Test public void testToSettings() { TelegramSettingsBean bean = new TelegramSettingsBean(new TelegramSettings()); bean.setBotToken("123123"); bean.setPaused(true); bean.setUseProxy(true); bean.setProxyServer("localhost"); bean.setProxyPort("345"); bean.setProxyUsername("user"); bean.setProxyPassword("123"); TelegramSettings settings = bean.toSettings(); assertEquals("123123", settings.getBotToken()); assertTrue(settings.isPaused()); assertTrue(settings.isUseProxy()); assertEquals("localhost", settings.getProxyServer()); assertEquals(Integer.valueOf(345), settings.getProxyPort()); assertEquals("user", settings.getProxyUsername()); assertEquals("123", settings.getProxyPassword()); }
public TelegramSettings toSettings() { TelegramSettings settings = new TelegramSettings(); settings.setBotToken(botToken); settings.setPaused(paused); settings.setUseProxy(useProxy); settings.setProxyServer(proxyServer); settings.setProxyPort(StringUtil.isEmpty(proxyPort) ? null : Integer.valueOf(proxyPort)); settings.setProxyUsername(proxyUsername); settings.setProxyPassword(proxyPassword); return settings; }
TelegramSettingsBean extends RememberState { public TelegramSettings toSettings() { TelegramSettings settings = new TelegramSettings(); settings.setBotToken(botToken); settings.setPaused(paused); settings.setUseProxy(useProxy); settings.setProxyServer(proxyServer); settings.setProxyPort(StringUtil.isEmpty(proxyPort) ? null : Integer.valueOf(proxyPort)); settings.setProxyUsername(proxyUsername); settings.setProxyPassword(proxyPassword); return settings; } }
TelegramSettingsBean extends RememberState { public TelegramSettings toSettings() { TelegramSettings settings = new TelegramSettings(); settings.setBotToken(botToken); settings.setPaused(paused); settings.setUseProxy(useProxy); settings.setProxyServer(proxyServer); settings.setProxyPort(StringUtil.isEmpty(proxyPort) ? null : Integer.valueOf(proxyPort)); settings.setProxyUsername(proxyUsername); settings.setProxyPassword(proxyPassword); return settings; } TelegramSettingsBean(@NotNull TelegramSettings settings); }
TelegramSettingsBean extends RememberState { public TelegramSettings toSettings() { TelegramSettings settings = new TelegramSettings(); settings.setBotToken(botToken); settings.setPaused(paused); settings.setUseProxy(useProxy); settings.setProxyServer(proxyServer); settings.setProxyPort(StringUtil.isEmpty(proxyPort) ? null : Integer.valueOf(proxyPort)); settings.setProxyUsername(proxyUsername); settings.setProxyPassword(proxyPassword); return settings; } TelegramSettingsBean(@NotNull TelegramSettings settings); String getBotToken(); void setBotToken(String botToken); String getHexEncodedPublicKey(); String getEncryptedBotToken(); void setEncryptedBotToken(String encrypted); boolean isPaused(); void setPaused(boolean paused); boolean isUseProxy(); void setUseProxy(boolean useProxy); String getProxyServer(); void setProxyServer(String proxyServer); String getProxyPort(); void setProxyPort(String proxyPort); String getProxyUsername(); void setProxyUsername(String proxyUsername); String getProxyPassword(); void setProxyPassword(String proxyPassword); String getEncryptedProxyPassword(); void setEncryptedProxyPassword(String encrypted); TelegramSettings toSettings(); }
TelegramSettingsBean extends RememberState { public TelegramSettings toSettings() { TelegramSettings settings = new TelegramSettings(); settings.setBotToken(botToken); settings.setPaused(paused); settings.setUseProxy(useProxy); settings.setProxyServer(proxyServer); settings.setProxyPort(StringUtil.isEmpty(proxyPort) ? null : Integer.valueOf(proxyPort)); settings.setProxyUsername(proxyUsername); settings.setProxyPassword(proxyPassword); return settings; } TelegramSettingsBean(@NotNull TelegramSettings settings); String getBotToken(); void setBotToken(String botToken); String getHexEncodedPublicKey(); String getEncryptedBotToken(); void setEncryptedBotToken(String encrypted); boolean isPaused(); void setPaused(boolean paused); boolean isUseProxy(); void setUseProxy(boolean useProxy); String getProxyServer(); void setProxyServer(String proxyServer); String getProxyPort(); void setProxyPort(String proxyPort); String getProxyUsername(); void setProxyUsername(String proxyUsername); String getProxyPassword(); void setProxyPassword(String proxyPassword); String getEncryptedProxyPassword(); void setEncryptedProxyPassword(String encrypted); TelegramSettings toSettings();  }