org.robokind.api.common.lifecycle
Class ServiceLifecycleProvider.Validator

java.lang.Object
  extended by org.robokind.api.common.lifecycle.ServiceLifecycleProvider.Validator
Enclosing interface:
ServiceLifecycleProvider<T>

public static class ServiceLifecycleProvider.Validator
extends Object

The Validator is used validate a dependencyId and dependency against a list of DependencyDescriptors.


Constructor Summary
ServiceLifecycleProvider.Validator()
           
 
Method Summary
static boolean validateService(List<DependencyDescriptor> descriptors, String dependencyId, Object dependency)
          Validates an id and dependency against a list of DependencyDescriptors.
static boolean validateServiceId(List<DependencyDescriptor> descriptors, String dependencyId)
          Returns true if there is a DependencyDescriptor with the given dependency id.
static boolean validateServices(List<DependencyDescriptor> descriptors, Map<String,Object> depdendencies)
          Validates a map of dependency ids and services to validate against a list of DependencyDescriptors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceLifecycleProvider.Validator

public ServiceLifecycleProvider.Validator()
Method Detail

validateServices

public static boolean validateServices(List<DependencyDescriptor> descriptors,
                                       Map<String,Object> depdendencies)
Validates a map of dependency ids and services to validate against a list of DependencyDescriptors. A map is valid if it has a dependency matching each descriptor in the list. A descriptor is matched if there is an entry where the key and the dependency's class matches the descriptor's fields.

Parameters:
descriptors - list of DependencyDescriptors needed to be matched
depdendencies - map of ids and dependencies
Returns:
true if there is a dependency in the map for each descriptor, false if one or more descriptors is not filled

validateService

public static boolean validateService(List<DependencyDescriptor> descriptors,
                                      String dependencyId,
                                      Object dependency)
Validates an id and dependency against a list of DependencyDescriptors. The id and dependency are valid if there is a descriptor with a matching dependency id and class.

Parameters:
descriptors - list of DependencyDescriptors to match against
dependencyId - id for the dependency
dependency - dependency to validate
Returns:
true if a matching descriptor is found

validateServiceId

public static boolean validateServiceId(List<DependencyDescriptor> descriptors,
                                        String dependencyId)
Returns true if there is a DependencyDescriptor with the given dependency id.

Parameters:
descriptors - list of DependencyDescriptors to search
dependencyId - dependency id to search for
Returns:
true if there is a DependencyDescriptor with the given dependency id


Copyright © 2011-2013. All Rights Reserved.