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

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

public class ReferencePredicates
extends Object

Predicates for working with Reference collections.

Author:
Adrian Cole

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

Constructor Detail

ReferencePredicates

public ReferencePredicates()
Method Detail

nameEquals

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

Parameters:
T - type of the reference, for example Link
name - value of the name attribute of the referenced object
Returns:
predicate that will match references of the given name

nameStartsWith

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

Parameters:
T - type of the reference, for example Link
name - prefix of the name attribute of the referenced object
Returns:
predicate that will match references with names starting with the given prefix

nameIn

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

Parameters:
T - type of the reference, for example Link
names - collection of values for the name attribute of the referenced object
Returns:
predicate that will match references with names starting with the given prefix

typeEquals

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

Parameters:
T - type of the reference, for example Link
type - the media type string of the referenced object, for example VCloudDirectorMediaType#CATALOG
Returns:
predicate that will match references of the given type
See Also:
VCloudDirectorMediaType

hrefEquals

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

Parameters:
T - type of the reference, for example Link
href - the URI of the reference
Returns:
predicate that will match references with the given URI
See Also:
VCloudDirectorMediaType


Copyright © 2009-2012 jclouds. All Rights Reserved.