Format code, no actual code changed.
parent
5d14efc50f
commit
2413366adb
|
@ -1,73 +1,73 @@
|
||||||
package us.codecraft.webmagic.proxy;
|
package us.codecraft.webmagic.proxy;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class Proxy {
|
public class Proxy {
|
||||||
|
|
||||||
private String host;
|
private String host;
|
||||||
private int port;
|
|
||||||
private String username;
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
public Proxy(String host, int port) {
|
private int port;
|
||||||
this.host = host;
|
|
||||||
this.port = port;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Proxy(String host, int port, String username, String password) {
|
private String username;
|
||||||
this.host = host;
|
|
||||||
this.port = port;
|
|
||||||
this.username = username;
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHost() {
|
private String password;
|
||||||
return host;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPort() {
|
public Proxy(String host, int port) {
|
||||||
return port;
|
this.host = host;
|
||||||
}
|
this.port = port;
|
||||||
|
}
|
||||||
|
|
||||||
public String getUsername() {
|
public Proxy(String host, int port, String username, String password) {
|
||||||
return username;
|
this.host = host;
|
||||||
}
|
this.port = port;
|
||||||
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
public String getPassword() {
|
public String getHost() {
|
||||||
return password;
|
return host;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public int getPort() {
|
||||||
public boolean equals(Object o) {
|
return port;
|
||||||
if (this == o) return true;
|
}
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
|
||||||
|
|
||||||
Proxy proxy = (Proxy) o;
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
if (port != proxy.port) return false;
|
public String getPassword() {
|
||||||
if (host != null ? !host.equals(proxy.host) : proxy.host != null) return false;
|
return password;
|
||||||
if (username != null ? !username.equals(proxy.username) : proxy.username != null) return false;
|
}
|
||||||
return password != null ? password.equals(proxy.password) : proxy.password == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public boolean equals(Object o) {
|
||||||
int result = host != null ? host.hashCode() : 0;
|
if (this == o) return true;
|
||||||
result = 31 * result + port;
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
result = 31 * result + (username != null ? username.hashCode() : 0);
|
|
||||||
result = 31 * result + (password != null ? password.hashCode() : 0);
|
Proxy proxy = (Proxy) o;
|
||||||
return result;
|
|
||||||
}
|
if (port != proxy.port) return false;
|
||||||
|
if (host != null ? !host.equals(proxy.host) : proxy.host != null) return false;
|
||||||
|
if (username != null ? !username.equals(proxy.username) : proxy.username != null) return false;
|
||||||
|
return password != null ? password.equals(proxy.password) : proxy.password == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = host != null ? host.hashCode() : 0;
|
||||||
|
result = 31 * result + port;
|
||||||
|
result = 31 * result + (username != null ? username.hashCode() : 0);
|
||||||
|
result = 31 * result + (password != null ? password.hashCode() : 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Proxy{" +
|
||||||
|
"host='" + host + '\'' +
|
||||||
|
", port=" + port +
|
||||||
|
", username='" + username + '\'' +
|
||||||
|
", password='" + password + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Proxy{" +
|
|
||||||
"host='" + host + '\'' +
|
|
||||||
", port=" + port +
|
|
||||||
", username='" + username + '\'' +
|
|
||||||
", password='" + password + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,4 +59,5 @@ public class SimpleProxyProvider implements ProxyProvider {
|
||||||
}
|
}
|
||||||
return p % size;
|
return p % size;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue