@Test public void testEquals() { assertTrue( ipRuleSet1.equals( ipRuleSet2 ) ); }
@Override public boolean equals( final Object obj ) { if( ! ( obj instanceof IpRule ) ) { return false; } IpRule rule = ( IpRule )obj; if( ! fromPort.equals( rule.getFromPort() ) || ! toPort.equals( rule.getToPort() ) || ! ipProtocol.equals( rule.getIpProtocol() ) || ipRanges.size() != rule.getIpRanges().size() ) { return false; } for( String myRange: ipRanges ) { boolean exists = false; for( String range: rule.getIpRanges() ) { if( myRange.equals( range ) ) { exists = true; break; } } if( ! exists ) { return false; } } return true; }
BasicIpRule implements IpRule { @Override public boolean equals( final Object obj ) { if( ! ( obj instanceof IpRule ) ) { return false; } IpRule rule = ( IpRule )obj; if( ! fromPort.equals( rule.getFromPort() ) || ! toPort.equals( rule.getToPort() ) || ! ipProtocol.equals( rule.getIpProtocol() ) || ipRanges.size() != rule.getIpRanges().size() ) { return false; } for( String myRange: ipRanges ) { boolean exists = false; for( String range: rule.getIpRanges() ) { if( myRange.equals( range ) ) { exists = true; break; } } if( ! exists ) { return false; } } return true; } }
BasicIpRule implements IpRule { @Override public boolean equals( final Object obj ) { if( ! ( obj instanceof IpRule ) ) { return false; } IpRule rule = ( IpRule )obj; if( ! fromPort.equals( rule.getFromPort() ) || ! toPort.equals( rule.getToPort() ) || ! ipProtocol.equals( rule.getIpProtocol() ) || ipRanges.size() != rule.getIpRanges().size() ) { return false; } for( String myRange: ipRanges ) { boolean exists = false; for( String range: rule.getIpRanges() ) { if( myRange.equals( range ) ) { exists = true; break; } } if( ! exists ) { return false; } } return true; }  }
BasicIpRule implements IpRule { @Override public boolean equals( final Object obj ) { if( ! ( obj instanceof IpRule ) ) { return false; } IpRule rule = ( IpRule )obj; if( ! fromPort.equals( rule.getFromPort() ) || ! toPort.equals( rule.getToPort() ) || ! ipProtocol.equals( rule.getIpProtocol() ) || ipRanges.size() != rule.getIpRanges().size() ) { return false; } for( String myRange: ipRanges ) { boolean exists = false; for( String range: rule.getIpRanges() ) { if( myRange.equals( range ) ) { exists = true; break; } } if( ! exists ) { return false; } } return true; }  @Override String getIpProtocol(); void setIpProtocol( final String ipProtocol ); @Override IpRule withIpProtocol( final String ipProtocol ); @Override Integer getFromPort(); void setFromPort( Integer fromPort ); @Override IpRule withFromPort( final Integer fromPort ); @Override Integer getToPort(); @Override IpRule withToPort( final Integer toPort ); void setToPort( Integer toPort ); @Override List<String> getIpRanges(); void setIpRanges( List<String> ipRanges ); @Override IpRule withIpRanges( final String... ipRanges ); @Override boolean equals( final Object obj ); }
BasicIpRule implements IpRule { @Override public boolean equals( final Object obj ) { if( ! ( obj instanceof IpRule ) ) { return false; } IpRule rule = ( IpRule )obj; if( ! fromPort.equals( rule.getFromPort() ) || ! toPort.equals( rule.getToPort() ) || ! ipProtocol.equals( rule.getIpProtocol() ) || ipRanges.size() != rule.getIpRanges().size() ) { return false; } for( String myRange: ipRanges ) { boolean exists = false; for( String range: rule.getIpRanges() ) { if( myRange.equals( range ) ) { exists = true; break; } } if( ! exists ) { return false; } } return true; }  @Override String getIpProtocol(); void setIpProtocol( final String ipProtocol ); @Override IpRule withIpProtocol( final String ipProtocol ); @Override Integer getFromPort(); void setFromPort( Integer fromPort ); @Override IpRule withFromPort( final Integer fromPort ); @Override Integer getToPort(); @Override IpRule withToPort( final Integer toPort ); void setToPort( Integer toPort ); @Override List<String> getIpRanges(); void setIpRanges( List<String> ipRanges ); @Override IpRule withIpRanges( final String... ipRanges ); @Override boolean equals( final Object obj );  }