@Test public void testCompareExclusionCidrBlocks() { final IpPermission tcp = builder().ipProtocol(IpProtocol.TCP).build(); final IpPermission everything = builder().fromPermission(tcp) .exclusionCidrBlock("0.0.0.0/0").build(); final IpPermission universal = builder().fromPermission(tcp) .exclusionCidrBlock("0.0.0.0/0").build(); assertEqualAndComparable(everything, universal); final IpPermission localhost = builder().fromPermission(tcp) .exclusionCidrBlock("127.0.0.1/32").build(); final IpPermission stillLocal = builder().fromPermission(tcp) .exclusionCidrBlock("127.0.0.1/32").build(); assertEqualAndComparable(localhost, stillLocal); final IpPermission tenTwentyOne = builder().fromPermission(tcp) .exclusionCidrBlock("10.0.0.21/32").build(); final IpPermission tenTwoHundred = builder().fromPermission(tcp) .exclusionCidrBlock("10.0.0.200/32").build(); assertOrder(tenTwoHundred, tenTwentyOne); assertTotalOrder(ImmutableList.of(tcp, everything, tenTwoHundred, tenTwentyOne, localhost)); }
public static Builder builder() { return new Builder(); }
IpPermission implements Comparable<IpPermission> { public static Builder builder() { return new Builder(); } }
IpPermission implements Comparable<IpPermission> { public static Builder builder() { return new Builder(); } IpPermission(IpProtocol ipProtocol, int fromPort, int toPort,
                       Multimap<String, String> tenantIdGroupNamePairs, Iterable<String> groupIds, Iterable<String> cidrBlocks,
                       Iterable<String> exclusionCidrBlocks); }
IpPermission implements Comparable<IpPermission> { public static Builder builder() { return new Builder(); } IpPermission(IpProtocol ipProtocol, int fromPort, int toPort,
                       Multimap<String, String> tenantIdGroupNamePairs, Iterable<String> groupIds, Iterable<String> cidrBlocks,
                       Iterable<String> exclusionCidrBlocks); static Builder builder(); IpProtocol getIpProtocol(); int getFromPort(); int getToPort(); Multimap<String, String> getTenantIdGroupNamePairs(); Set<String> getGroupIds(); Set<String> getCidrBlocks(); @Beta Set<String> getExclusionCidrBlocks(); @Override int compareTo(IpPermission that); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
IpPermission implements Comparable<IpPermission> { public static Builder builder() { return new Builder(); } IpPermission(IpProtocol ipProtocol, int fromPort, int toPort,
                       Multimap<String, String> tenantIdGroupNamePairs, Iterable<String> groupIds, Iterable<String> cidrBlocks,
                       Iterable<String> exclusionCidrBlocks); static Builder builder(); IpProtocol getIpProtocol(); int getFromPort(); int getToPort(); Multimap<String, String> getTenantIdGroupNamePairs(); Set<String> getGroupIds(); Set<String> getCidrBlocks(); @Beta Set<String> getExclusionCidrBlocks(); @Override int compareTo(IpPermission that); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }