@Test public void testCompare() { assertEquals(0, new Host(new TestProtocol(Scheme.ftp), "a", 33) .compareTo(new Host(new TestProtocol(Scheme.ftp), "a", 33))); assertEquals(-1, new Host(new TestProtocol(Scheme.ftp), "a", 22) .compareTo(new Host(new TestProtocol(Scheme.ftp), "a", 33))); assertEquals(1, new Host(new TestProtocol(Scheme.ftp), "a", 33) .compareTo(new Host(new TestProtocol(Scheme.ftp), "a", 22))); assertEquals(0, new Host(new TestProtocol(Scheme.sftp), "a", 22, new Credentials("u")) .compareTo(new Host(new TestProtocol(Scheme.sftp), "a", 22, new Credentials("u")))); assertEquals(0, new Host(new TestProtocol(Scheme.sftp), "a", 22, new Credentials("u")) .compareTo(new Host(new TestProtocol(Scheme.sftp), "a", 22, "/path", new Credentials("u")))); assertEquals(-1, new Host(new TestProtocol(Scheme.sftp), "a", 22, new Credentials()) .compareTo(new Host(new TestProtocol(Scheme.sftp), "a", 22, new Credentials("u")))); assertEquals(1, new Host(new TestProtocol(Scheme.sftp), "a", 22, new Credentials("u")) .compareTo(new Host(new TestProtocol(Scheme.sftp), "a", 22, new Credentials()))); assertEquals(0, new Host(new TestProtocol(Scheme.ftp), "a") .compareTo((new Host(new TestProtocol(Scheme.ftp), "a")))); assertEquals(-1, new Host(new TestProtocol(Scheme.ftp), "a") .compareTo((new Host(new TestProtocol(Scheme.ftp), "b")))); assertEquals(1, new Host(new TestProtocol(Scheme.ftp), "b") .compareTo((new Host(new TestProtocol(Scheme.ftp), "a")))); }
@Override public int compareTo(final Host o) { if(protocol.compareTo(o.protocol) < 0) { return -1; } else if(protocol.compareTo(o.protocol) > 0) { return 1; } if(port.compareTo(o.port) < 0) { return -1; } else if(port.compareTo(o.port) > 0) { return 1; } if(hostname.compareTo(o.hostname) < 0) { return -1; } else if(hostname.compareTo(o.hostname) > 0) { return 1; } if(credentials.compareTo(o.credentials) < 0) { return -1; } else if(credentials.compareTo(o.credentials) > 0) { return 1; } return 0; }
Host implements Serializable, Comparable<Host> { @Override public int compareTo(final Host o) { if(protocol.compareTo(o.protocol) < 0) { return -1; } else if(protocol.compareTo(o.protocol) > 0) { return 1; } if(port.compareTo(o.port) < 0) { return -1; } else if(port.compareTo(o.port) > 0) { return 1; } if(hostname.compareTo(o.hostname) < 0) { return -1; } else if(hostname.compareTo(o.hostname) > 0) { return 1; } if(credentials.compareTo(o.credentials) < 0) { return -1; } else if(credentials.compareTo(o.credentials) > 0) { return 1; } return 0; } }
Host implements Serializable, Comparable<Host> { @Override public int compareTo(final Host o) { if(protocol.compareTo(o.protocol) < 0) { return -1; } else if(protocol.compareTo(o.protocol) > 0) { return 1; } if(port.compareTo(o.port) < 0) { return -1; } else if(port.compareTo(o.port) > 0) { return 1; } if(hostname.compareTo(o.hostname) < 0) { return -1; } else if(hostname.compareTo(o.hostname) > 0) { return 1; } if(credentials.compareTo(o.credentials) < 0) { return -1; } else if(credentials.compareTo(o.credentials) > 0) { return 1; } return 0; } Host(final Protocol protocol);  Host(final Protocol protocol, final String hostname);  Host(final Protocol protocol, final String hostname, final Credentials credentials);  Host(final Protocol protocol, final String hostname, final int port);  Host(final Protocol protocol, final String hostname, final int port, final String defaultpath);  Host(final Protocol protocol, final String hostname, final int port, final Credentials credentials);  Host(final Protocol protocol, final String hostname, final int port, final String defaultpath, final Credentials credentials);  Host(final Host other); }
Host implements Serializable, Comparable<Host> { @Override public int compareTo(final Host o) { if(protocol.compareTo(o.protocol) < 0) { return -1; } else if(protocol.compareTo(o.protocol) > 0) { return 1; } if(port.compareTo(o.port) < 0) { return -1; } else if(port.compareTo(o.port) > 0) { return 1; } if(hostname.compareTo(o.hostname) < 0) { return -1; } else if(hostname.compareTo(o.hostname) > 0) { return 1; } if(credentials.compareTo(o.credentials) < 0) { return -1; } else if(credentials.compareTo(o.credentials) > 0) { return 1; } return 0; } Host(final Protocol protocol);  Host(final Protocol protocol, final String hostname);  Host(final Protocol protocol, final String hostname, final Credentials credentials);  Host(final Protocol protocol, final String hostname, final int port);  Host(final Protocol protocol, final String hostname, final int port, final String defaultpath);  Host(final Protocol protocol, final String hostname, final int port, final Credentials credentials);  Host(final Protocol protocol, final String hostname, final int port, final String defaultpath, final Credentials credentials);  Host(final Host other); @Override T serialize(final Serializer dict); String getDefaultPath(); void setDefaultPath(final String defaultpath); Path getWorkdir(); void setWorkdir(final Path workdir); Credentials getCredentials(); void setCredentials(final Credentials credentials); Host withCredentials(final Credentials credentials); Credentials getCdnCredentials(); Protocol getProtocol(); void setProtocol(final Protocol protocol); String getUuid(); void setUuid(String uuid); String getNickname(); void setNickname(String nickname); String getHostname(); void setHostname(final String hostname); int getPort(); void setPort(final int port); String getEncoding(); void setEncoding(final String encoding); FTPConnectMode getFTPConnectMode(); void setFTPConnectMode(final FTPConnectMode connectMode); TransferType getTransferType(); void setTransfer(final TransferType transfer); Local getDownloadFolder(); void setDownloadFolder(final Local folder); Local getUploadFolder(); void setUploadFolder(final Local folder); TimeZone getTimezone(); void setTimezone(final TimeZone timezone); String getRegion(); void setRegion(final String region); String getComment(); void setComment(final String comment); String getWebURL(); void setWebURL(final String url); Host withWebURL(final String url); Date getTimestamp(); void setTimestamp(Date timestamp); Local getVolume(); void setVolume(final Local volume); Boolean getReadonly(); void setReadonly(final Boolean readonly); Map<String, String> getCustom(); void setCustom(final Map<String, String> custom); Set<String> getLabels(); void setLabels(final Set<String> labels); @Override boolean equals(Object other); @Override int hashCode(); @Override int compareTo(final Host o); @Override String toString(); }
Host implements Serializable, Comparable<Host> { @Override public int compareTo(final Host o) { if(protocol.compareTo(o.protocol) < 0) { return -1; } else if(protocol.compareTo(o.protocol) > 0) { return 1; } if(port.compareTo(o.port) < 0) { return -1; } else if(port.compareTo(o.port) > 0) { return 1; } if(hostname.compareTo(o.hostname) < 0) { return -1; } else if(hostname.compareTo(o.hostname) > 0) { return 1; } if(credentials.compareTo(o.credentials) < 0) { return -1; } else if(credentials.compareTo(o.credentials) > 0) { return 1; } return 0; } Host(final Protocol protocol);  Host(final Protocol protocol, final String hostname);  Host(final Protocol protocol, final String hostname, final Credentials credentials);  Host(final Protocol protocol, final String hostname, final int port);  Host(final Protocol protocol, final String hostname, final int port, final String defaultpath);  Host(final Protocol protocol, final String hostname, final int port, final Credentials credentials);  Host(final Protocol protocol, final String hostname, final int port, final String defaultpath, final Credentials credentials);  Host(final Host other); @Override T serialize(final Serializer dict); String getDefaultPath(); void setDefaultPath(final String defaultpath); Path getWorkdir(); void setWorkdir(final Path workdir); Credentials getCredentials(); void setCredentials(final Credentials credentials); Host withCredentials(final Credentials credentials); Credentials getCdnCredentials(); Protocol getProtocol(); void setProtocol(final Protocol protocol); String getUuid(); void setUuid(String uuid); String getNickname(); void setNickname(String nickname); String getHostname(); void setHostname(final String hostname); int getPort(); void setPort(final int port); String getEncoding(); void setEncoding(final String encoding); FTPConnectMode getFTPConnectMode(); void setFTPConnectMode(final FTPConnectMode connectMode); TransferType getTransferType(); void setTransfer(final TransferType transfer); Local getDownloadFolder(); void setDownloadFolder(final Local folder); Local getUploadFolder(); void setUploadFolder(final Local folder); TimeZone getTimezone(); void setTimezone(final TimeZone timezone); String getRegion(); void setRegion(final String region); String getComment(); void setComment(final String comment); String getWebURL(); void setWebURL(final String url); Host withWebURL(final String url); Date getTimestamp(); void setTimestamp(Date timestamp); Local getVolume(); void setVolume(final Local volume); Boolean getReadonly(); void setReadonly(final Boolean readonly); Map<String, String> getCustom(); void setCustom(final Map<String, String> custom); Set<String> getLabels(); void setLabels(final Set<String> labels); @Override boolean equals(Object other); @Override int hashCode(); @Override int compareTo(final Host o); @Override String toString();  }