@Test public void testEquals() { ServerConfig config1 = new ServerConfig(); Assert.assertTrue(config1.equals(config1)); Assert.assertFalse(config1.equals(null)); Assert.assertFalse(config1.equals("")); ServerConfig config2 = new ServerConfig(); Assert.assertTrue(config1.equals(config2)); config1.setHost("127.0.0.1"); Assert.assertFalse(config1.equals(config2)); config2.setHost("127.0.0.2"); Assert.assertFalse(config1.equals(config2)); config2.setHost("127.0.0.1"); Assert.assertTrue(config1.equals(config2)); config1.setPort(1234); Assert.assertFalse(config1.equals(config2)); config2.setPort(1235); Assert.assertFalse(config1.equals(config2)); config2.setPort(1234); Assert.assertTrue(config1.equals(config2)); config1.setProtocol("xxx"); Assert.assertFalse(config1.equals(config2)); config2.setProtocol("yyy"); Assert.assertFalse(config1.equals(config2)); config2.setProtocol("xxx"); Assert.assertTrue(config1.equals(config2)); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ServerConfig other = (ServerConfig) obj; if (host == null) { if (other.host != null) { return false; } } else if (!host.equals(other.host)) { return false; } if (port != other.port) { return false; } if (protocol == null) { if (other.protocol != null) { return false; } } else if (!protocol.equals(other.protocol)) { return false; } return true; }
ServerConfig extends AbstractIdConfig implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ServerConfig other = (ServerConfig) obj; if (host == null) { if (other.host != null) { return false; } } else if (!host.equals(other.host)) { return false; } if (port != other.port) { return false; } if (protocol == null) { if (other.protocol != null) { return false; } } else if (!protocol.equals(other.protocol)) { return false; } return true; } }
ServerConfig extends AbstractIdConfig implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ServerConfig other = (ServerConfig) obj; if (host == null) { if (other.host != null) { return false; } } else if (!host.equals(other.host)) { return false; } if (port != other.port) { return false; } if (protocol == null) { if (other.protocol != null) { return false; } } else if (!protocol.equals(other.protocol)) { return false; } return true; }  }
ServerConfig extends AbstractIdConfig implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ServerConfig other = (ServerConfig) obj; if (host == null) { if (other.host != null) { return false; } } else if (!host.equals(other.host)) { return false; } if (port != other.port) { return false; } if (protocol == null) { if (other.protocol != null) { return false; } } else if (!protocol.equals(other.protocol)) { return false; } return true; }  synchronized Server buildIfAbsent(); synchronized void destroy(); String getProtocol(); ServerConfig setProtocol(String protocol); String getHost(); ServerConfig setHost(String host); int getPort(); ServerConfig setPort(int port); String getContextPath(); ServerConfig setContextPath(String contextPath); int getIoThreads(); ServerConfig setIoThreads(int ioThreads); String getThreadPoolType(); ServerConfig setThreadPoolType(String threadPoolType); int getCoreThreads(); ServerConfig setCoreThreads(int coreThreads); int getMaxThreads(); ServerConfig setMaxThreads(int maxThreads); boolean isTelnet(); ServerConfig setTelnet(boolean telnet); String getQueueType(); ServerConfig setQueueType(String queueType); int getQueues(); ServerConfig setQueues(int queues); int getAliveTime(); ServerConfig setAliveTime(int aliveTime); boolean isPreStartCore(); ServerConfig setPreStartCore(boolean preStartCore); int getAccepts(); ServerConfig setAccepts(int accepts); int getPayload(); ServerConfig setPayload(int payload); String getSerialization(); ServerConfig setSerialization(String serialization); String getDispatcher(); ServerConfig setDispatcher(String dispatcher); Map<String, String> getParameters(); ServerConfig setParameters(Map<String, String> parameters); String getVirtualHost(); ServerConfig setVirtualHost(String virtualHost); Integer getVirtualPort(); ServerConfig setVirtualPort(Integer virtualPort); List<ChannelListener> getOnConnect(); ServerConfig setOnConnect(List<ChannelListener> onConnect); boolean isEpoll(); ServerConfig setEpoll(boolean epoll); boolean isDaemon(); ServerConfig setDaemon(boolean daemon); String getTransport(); ServerConfig setTransport(String transport); boolean isAdaptivePort(); ServerConfig setAdaptivePort(boolean adaptivePort); boolean isAutoStart(); ServerConfig setAutoStart(boolean autoStart); int getStopTimeout(); ServerConfig setStopTimeout(int stopTimeout); Server getServer(); void setServer(Server server); ServerConfig setBoundHost(String boundHost); String getBoundHost(); boolean isKeepAlive(); ServerConfig setKeepAlive(boolean keepAlive); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
ServerConfig extends AbstractIdConfig implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ServerConfig other = (ServerConfig) obj; if (host == null) { if (other.host != null) { return false; } } else if (!host.equals(other.host)) { return false; } if (port != other.port) { return false; } if (protocol == null) { if (other.protocol != null) { return false; } } else if (!protocol.equals(other.protocol)) { return false; } return true; }  synchronized Server buildIfAbsent(); synchronized void destroy(); String getProtocol(); ServerConfig setProtocol(String protocol); String getHost(); ServerConfig setHost(String host); int getPort(); ServerConfig setPort(int port); String getContextPath(); ServerConfig setContextPath(String contextPath); int getIoThreads(); ServerConfig setIoThreads(int ioThreads); String getThreadPoolType(); ServerConfig setThreadPoolType(String threadPoolType); int getCoreThreads(); ServerConfig setCoreThreads(int coreThreads); int getMaxThreads(); ServerConfig setMaxThreads(int maxThreads); boolean isTelnet(); ServerConfig setTelnet(boolean telnet); String getQueueType(); ServerConfig setQueueType(String queueType); int getQueues(); ServerConfig setQueues(int queues); int getAliveTime(); ServerConfig setAliveTime(int aliveTime); boolean isPreStartCore(); ServerConfig setPreStartCore(boolean preStartCore); int getAccepts(); ServerConfig setAccepts(int accepts); int getPayload(); ServerConfig setPayload(int payload); String getSerialization(); ServerConfig setSerialization(String serialization); String getDispatcher(); ServerConfig setDispatcher(String dispatcher); Map<String, String> getParameters(); ServerConfig setParameters(Map<String, String> parameters); String getVirtualHost(); ServerConfig setVirtualHost(String virtualHost); Integer getVirtualPort(); ServerConfig setVirtualPort(Integer virtualPort); List<ChannelListener> getOnConnect(); ServerConfig setOnConnect(List<ChannelListener> onConnect); boolean isEpoll(); ServerConfig setEpoll(boolean epoll); boolean isDaemon(); ServerConfig setDaemon(boolean daemon); String getTransport(); ServerConfig setTransport(String transport); boolean isAdaptivePort(); ServerConfig setAdaptivePort(boolean adaptivePort); boolean isAutoStart(); ServerConfig setAutoStart(boolean autoStart); int getStopTimeout(); ServerConfig setStopTimeout(int stopTimeout); Server getServer(); void setServer(Server server); ServerConfig setBoundHost(String boundHost); String getBoundHost(); boolean isKeepAlive(); ServerConfig setKeepAlive(boolean keepAlive); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }