@Test public void testHashCode() { ServerConfig config1 = new ServerConfig(); ServerConfig config2 = new ServerConfig(); config1.setHost("127.0.0.1").setPort(1234).setProtocol("xxx"); config2.setHost("127.0.0.1").setPort(1235).setProtocol("xxx"); Assert.assertFalse(config1.hashCode() == config2.hashCode()); config2.setPort(1234); Assert.assertTrue(config1.hashCode() == config2.hashCode()); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((host == null) ? 0 : host.hashCode()); result = prime * result + port; result = prime * result + ((protocol == null) ? 0 : protocol.hashCode()); return result; }
ServerConfig extends AbstractIdConfig implements Serializable { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((host == null) ? 0 : host.hashCode()); result = prime * result + port; result = prime * result + ((protocol == null) ? 0 : protocol.hashCode()); return result; } }
ServerConfig extends AbstractIdConfig implements Serializable { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((host == null) ? 0 : host.hashCode()); result = prime * result + port; result = prime * result + ((protocol == null) ? 0 : protocol.hashCode()); return result; }  }
ServerConfig extends AbstractIdConfig implements Serializable { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((host == null) ? 0 : host.hashCode()); result = prime * result + port; result = prime * result + ((protocol == null) ? 0 : protocol.hashCode()); return result; }  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 int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((host == null) ? 0 : host.hashCode()); result = prime * result + port; result = prime * result + ((protocol == null) ? 0 : protocol.hashCode()); return result; }  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();  }