org.apache.whirr
Class RolePredicates
java.lang.Object
org.apache.whirr.RolePredicates
public class RolePredicates
- extends Object
Predicate
s for matching Cluster.Instance
s with certain cluster roles.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RolePredicates
public RolePredicates()
role
public static com.google.common.base.Predicate<Cluster.Instance> role(String role)
- Parameters:
role
-
- Returns:
- A
Predicate
that matches Cluster.Instance
s whose roles
include role
.
onlyRolesIn
public static com.google.common.base.Predicate<Cluster.Instance> onlyRolesIn(Set<String> roles)
- Parameters:
roles
-
- Returns:
- A
Predicate
that matches Cluster.Instance
s whose roles
are exactly the same as those in roles
.
allRolesIn
public static com.google.common.base.Predicate<Cluster.Instance> allRolesIn(Set<String> roles)
- Parameters:
roles
-
- Returns:
- A
Predicate
that matches Cluster.Instance
s whose roles
contain all of roles
.
anyRoleIn
public static com.google.common.base.Predicate<Cluster.Instance> anyRoleIn(Set<String> roles)
- Parameters:
roles
-
- Returns:
- A
Predicate
that matches Cluster.Instance
s whose roles
contain at least one of roles
.
withIds
public static com.google.common.base.Predicate<Cluster.Instance> withIds(String... ids)
- Parameters:
ids
- list of instance ids
- Returns:
- A
Predicate
that matches Cluster.Instance
whose id is
found in the IDs list
withIds
public static com.google.common.base.Predicate<Cluster.Instance> withIds(Set<String> ids)
- Parameters:
ids
- list of instance ids
- Returns:
- A
Predicate
that matches Cluster.Instance
whose id is
found in the IDs list
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.