@Test public void testCompareProtocol() { final IpPermission tcp = builder().ipProtocol(IpProtocol.TCP).build(); final IpPermission tcp2 = builder().ipProtocol(IpProtocol.TCP).build(); assertEqualAndComparable(tcp, tcp2); final IpPermission udp = builder().ipProtocol(IpProtocol.UDP).build(); assertOrder(tcp, udp); final IpPermission t10 = builder().fromPermission(tcp).fromPort(10).build(); final IpPermission t20 = builder().fromPermission(tcp).fromPort(20).build(); final IpPermission u10 = builder().fromPermission(udp).fromPort(10).build(); final IpPermission t0to10 = builder().fromPermission(tcp).toPort(10).build(); final IpPermission t0to20 = builder().fromPermission(tcp).toPort(20).build(); assertTotalOrder(ImmutableList.of(tcp, t0to10, t0to20, t10, t20, 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();  }