com.elastisys.scale.cloudpool.openstack.predicates

## Class ServerPredicates

- java.lang.Object
- - com.elastisys.scale.cloudpool.openstack.predicates.ServerPredicates

    public class ServerPredicates
    extends Object

`Predicate`s relating to Openstack `Server` instances.

### Constructor Summary

Constructors
Constructor and Description
`ServerPredicates()`

### Method Summary

All Methods Static Methods Concrete Methods
`static com.google.common.base.Predicate<? super org.openstack4j.model.compute.Server>` `withStateIn(org.openstack4j.model.compute.Server.Status... statuses)` Creates a `Predicate` function that returns `true` for any `Server` with a status in a set of allowed values.
`static com.google.common.base.Predicate<org.openstack4j.model.compute.Server>` `withTag(String tag, String tagValue)` Creates a `Predicate` that checks `Server` instances for the existence of a given meta data tag.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ServerPredicates

    public ServerPredicates()

### Method Detail

#### withTag

    public static com.google.common.base.Predicate<org.openstack4j.model.compute.Server> withTag(String tag,
                                                                                                 String tagValue)

Creates a `Predicate` that checks `Server` instances for the existence of a given meta data tag.

The predicate will return `true` for all `Server` instances with a given tag value in its user meta data.

Parameters:
  `tag` - The meta data tag.
  `value` - The expected value of the meta data tag.
Returns:
  A predicate that returns `true` for `Server` instances with the given tag value and `false` for all other `Server` instances.

#### withStateIn

    public static com.google.common.base.Predicate<? super org.openstack4j.model.compute.Server> withStateIn(org.openstack4j.model.compute.Server.Status... statuses)

Creates a `Predicate` function that returns `true` for any `Server` with a status in a set of allowed values.

Parameters:
  `statuses` - The allowed server `Server.Status`es.
Returns:
  A predicate that returns `true` for `Server` instances in a certain state.