Class SecurityGroupPredicates


  • public class SecurityGroupPredicates
    extends Object
    Predicates handy when working with SecurityGroups
    • Constructor Detail

      • SecurityGroupPredicates

        public SecurityGroupPredicates()
    • Method Detail

      • nameEquals

        public static com.google.common.base.Predicate<SecurityGroup> nameEquals​(String name)
        matches name of the given security group
        Parameters:
        name -
        Returns:
        predicate that matches name
      • nameIn

        public static com.google.common.base.Predicate<SecurityGroup> nameIn​(Set<String> names)
        matches name of the given security group against a list
        Parameters:
        names -
        Returns:
        predicate that matches one of the names
      • nameMatches

        public static com.google.common.base.Predicate<SecurityGroup> nameMatches​(com.google.common.base.Predicate<String> name)
        matches name of the given security group
        Parameters:
        name -
        Returns:
        predicate that matches name
      • ruleCidr

        public static com.google.common.base.Predicate<SecurityGroupRule> ruleCidr​(String cidr)
        matches a security group rule by its cidr
        Parameters:
        cidr -
        Returns:
        predicate that matches cidr
      • ruleGroup

        public static com.google.common.base.Predicate<SecurityGroupRule> ruleGroup​(String groupName)
        matches a security group rule by the security group it allows
        Parameters:
        groupName -
        Returns:
        predicate that matches group
      • ruleProtocol

        public static com.google.common.base.Predicate<SecurityGroupRule> ruleProtocol​(IpProtocol protocol)
        matches a security group rule by the protocol
        Parameters:
        protocol -
        Returns:
        predicate that matches protocol
      • ruleStartPort

        public static com.google.common.base.Predicate<SecurityGroupRule> ruleStartPort​(int startPort)
        matches a security group rule by the start port
        Parameters:
        startPort -
        Returns:
        predicate that matches startPort
      • ruleEndPort

        public static com.google.common.base.Predicate<SecurityGroupRule> ruleEndPort​(int endPort)
        matches a security group rule by the end port
        Parameters:
        endPort -
        Returns:
        predicate that matches endPort