org.jclouds.vcloud.director.v1_5.predicates
Class EntityPredicates

java.lang.Object
  extended by org.jclouds.vcloud.director.v1_5.predicates.EntityPredicates

public class EntityPredicates
extends Object

Predicates for working with EntityType collections.

Author:
grkvlt@apache.org, Adrian Cole

Constructor Summary
EntityPredicates()
           
 
Method Summary
static
<T extends Entity>
com.google.common.base.Predicate<T>
hrefEquals(URI href)
          Matches entities with the given URI.
static
<T extends Entity>
com.google.common.base.Predicate<T>
idEquals(String id)
          Matches entities with the given id.
static
<T extends Entity>
com.google.common.base.Predicate<T>
nameEquals(String name)
          Matches entities with the given name.
static
<T extends Entity>
com.google.common.base.Predicate<T>
nameIn(Iterable<String> names)
          Matches entities with names in the given collection.
static
<T extends Entity>
com.google.common.base.Predicate<T>
nameStartsWith(String prefix)
          Matches entities with names starting with the given prefix.
static
<T extends Entity>
com.google.common.base.Predicate<T>
typeEquals(String type)
          Matches entities of the given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityPredicates

public EntityPredicates()
Method Detail

idEquals

public static <T extends Entity> com.google.common.base.Predicate<T> idEquals(String id)
Matches entities with the given id.

Parameters:
T - type of the entity, for example Vm
id - value of the id attribute of the entity
Returns:
predicate that will match entities of the given id

nameEquals

public static <T extends Entity> com.google.common.base.Predicate<T> nameEquals(String name)
Matches entities with the given name.

Parameters:
T - type of the entity, for example Vm
name - value of the name attribute of the entity
Returns:
predicate that will match entities of the given name

nameStartsWith

public static <T extends Entity> com.google.common.base.Predicate<T> nameStartsWith(String prefix)
Matches entities with names starting with the given prefix.

Parameters:
T - type of the entity, for example Vm
name - prefix of the name attribute of the entity
Returns:
predicate that will match entities with names starting with the given prefix

nameIn

public static <T extends Entity> com.google.common.base.Predicate<T> nameIn(Iterable<String> names)
Matches entities with names in the given collection.

Parameters:
T - type of the entity, for example Vm
names - collection of values for the name attribute of the entity
Returns:
predicate that will match entities with names starting with the given prefix

typeEquals

public static <T extends Entity> com.google.common.base.Predicate<T> typeEquals(String type)
Matches entities of the given type.

Parameters:
T - type of the entity, for example Vm
type - the media type string of the entity, for example VCloudDirectorMediaType#CATALOG
Returns:
predicate that will match entities of the given type
See Also:
VCloudDirectorMediaType

hrefEquals

public static <T extends Entity> com.google.common.base.Predicate<T> hrefEquals(URI href)
Matches entities with the given URI.

Parameters:
T - type of the entity, for example Vm
href - the URI of the entity
Returns:
predicate that will match entities with the given URI
See Also:
VCloudDirectorMediaType


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.