1
package com.eucalyptus.net.util;
3
import com.google.common.collect.Lists;
5
public class ClusterAddressInfo {
10
public ClusterAddressInfo( String address ) {
11
this.address = address;
14
public static List<ClusterAddressInfo> fromLists( List<String> addresses, List<String> instanceIps ) {
15
return addresses.collect{ new ClusterAddressInfo( it ) }.eachWithIndex{ it, i -> it.instanceIp = instanceIps[ i ] }
19
public int hashCode( ) {
22
result = prime * result + ( ( this.address == null ) ? 0 : this.address.hashCode( ) );
27
public boolean equals( Object obj ) {
28
if ( this.is( obj ) ) return true;
29
if ( obj == null ) return false;
30
if ( !getClass( ).equals( obj.getClass( ) ) ) return false;
31
ClusterAddressInfo other = ( ClusterAddressInfo ) obj;
32
if ( this.address == null ) {
33
if ( other.address != null ) return false;
34
} else if ( !this.address.equals( other.address ) ) return false;
35
if ( this.instanceIp == null ) {
36
if ( other.instanceIp != null ) return false;
37
} else if ( !this.instanceIp.equals( other.instanceIp ) ) return false;