@Test public void testSetHost() { Proxy p1 = new Proxy( "type", "host", 80, null ); Proxy p2 = p1.setHost( null ); assertNotSame( p2, p1 ); assertEquals( "", p2.getHost() ); Proxy p3 = p1.setHost( "HOST" ); assertNotSame( p3, p1 ); assertEquals( "HOST", p3.getHost() ); }
public Proxy setHost( String host ) { if ( this.host.equals( host ) || ( host == null && this.host.length() <= 0 ) ) { return this; } return new Proxy( type, host, port, auth ); }
Proxy { public Proxy setHost( String host ) { if ( this.host.equals( host ) || ( host == null && this.host.length() <= 0 ) ) { return this; } return new Proxy( type, host, port, auth ); } }
Proxy { public Proxy setHost( String host ) { if ( this.host.equals( host ) || ( host == null && this.host.length() <= 0 ) ) { return this; } return new Proxy( type, host, port, auth ); } Proxy( String type, String host, int port, Authentication auth ); }
Proxy { public Proxy setHost( String host ) { if ( this.host.equals( host ) || ( host == null && this.host.length() <= 0 ) ) { return this; } return new Proxy( type, host, port, auth ); } Proxy( String type, String host, int port, Authentication auth ); String getType(); Proxy setType( String type ); String getHost(); Proxy setHost( String host ); int getPort(); Proxy setPort( int port ); Authentication getAuthentication(); Proxy setAuthentication( Authentication auth ); @Override String toString(); @Override boolean equals( Object obj ); @Override int hashCode(); }
Proxy { public Proxy setHost( String host ) { if ( this.host.equals( host ) || ( host == null && this.host.length() <= 0 ) ) { return this; } return new Proxy( type, host, port, auth ); } Proxy( String type, String host, int port, Authentication auth ); String getType(); Proxy setType( String type ); String getHost(); Proxy setHost( String host ); int getPort(); Proxy setPort( int port ); Authentication getAuthentication(); Proxy setAuthentication( Authentication auth ); @Override String toString(); @Override boolean equals( Object obj ); @Override int hashCode(); static final String TYPE_HTTP; static final String TYPE_HTTPS; }