@Test public void testPairwise() { final IpPermission tcp = builder().ipProtocol(IpProtocol.TCP).build(); final IpPermission udp = builder().ipProtocol(IpProtocol.UDP).build(); final IpPermission f10 = builder().fromPermission(tcp).fromPort(10).build(); final IpPermission f20 = builder().fromPermission(tcp).fromPort(20).build(); final IpPermission u10 = builder().fromPermission(udp).fromPort(10).build(); final IpPermission t20 = builder().fromPermission(f10).toPort(20).build(); final IpPermission t30 = builder().fromPermission(f10).toPort(30).build(); final IpPermission t2g1 = builder().fromPermission(t20) .tenantIdGroupNamePair("tenant1", "group1") .build(); final IpPermission t2g2 = builder().fromPermission(t20) .tenantIdGroupNamePair("tenant1", "group2") .build(); final IpPermission gidA = builder().fromPermission(t2g1) .groupId("groupA") .build(); final IpPermission gidB = builder().fromPermission(t2g1) .groupId("groupB") .build(); final IpPermission cidr10 = builder().fromPermission(gidA) .cidrBlock("10.10.10.10/32") .build(); final IpPermission cidr20 = builder().fromPermission(gidA) .cidrBlock("10.10.10.20/32") .build(); final IpPermission ex10 = builder().fromPermission(cidr10) .exclusionCidrBlock("172.16.10.10/32") .build(); final IpPermission ex20 = builder().fromPermission(cidr10) .exclusionCidrBlock("172.16.10.20/32") .build(); assertTotalOrder(ImmutableList.of( tcp, f10, t20, t2g1, gidA, cidr10, ex10, ex20, cidr20, gidB, t2g2, t30, f20, udp, u10 )); }
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();  }