org.robokind.api.common.osgi.lifecycle
Class DescriptorListBuilder

java.lang.Object
  extended by org.robokind.api.common.osgi.lifecycle.DescriptorListBuilder

public class DescriptorListBuilder
extends Object

Convenience class for building a List of DependencyDescriptors. Methods for adding descriptors return the DescriptorListBuilder to allow for method chaining. e.x.: List>DependencyDescriptor< descs = new DescriptorListBuilder().add(...).addId(...).getDescriptors();

Author:
Matthew Stevenson

Constructor Summary
DescriptorListBuilder()
          Creates an empty DescriptorListBuilder.
 
Method Summary
 DescriptorListBuilder add(String localDependencyId, Class clazz, String filter)
          Creates and adds a DependencyDescriptor with the given values.
 DescriptorListBuilder addId(String localDependencyId, Class clazz, String idPropertyName, String serviceId)
          Creates and adds a DependencyDescriptor with the given values.
 DescriptorListBuilder addId(String localDependencyId, Class clazz, String idPropertyName, String serviceId, String filter)
          Creates and adds a DependencyDescriptor with the given values.
 List<DependencyDescriptor> getDescriptors()
          Returns the list of DependencyDescriptors added to this list builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DescriptorListBuilder

public DescriptorListBuilder()
Creates an empty DescriptorListBuilder.

Method Detail

addId

public DescriptorListBuilder addId(String localDependencyId,
                                   Class clazz,
                                   String idPropertyName,
                                   String serviceId)
Creates and adds a DependencyDescriptor with the given values.

Parameters:
localDependencyId - dependency id used with a ServiceLifecycleProvider
clazz - dependency class
idPropertyName - property name for the dependency's service id
serviceId - service id of the dependency
Returns:
this list builder

addId

public DescriptorListBuilder addId(String localDependencyId,
                                   Class clazz,
                                   String idPropertyName,
                                   String serviceId,
                                   String filter)
Creates and adds a DependencyDescriptor with the given values.

Parameters:
localDependencyId - dependency id used with a ServiceLifecycleProvider
clazz - dependency class
idPropertyName - property name for the dependency's service id
serviceId - service id of the dependency
filter - optional OSGi filter String
Returns:
this list builder

add

public DescriptorListBuilder add(String localDependencyId,
                                 Class clazz,
                                 String filter)
Creates and adds a DependencyDescriptor with the given values.

Parameters:
localDependencyId - dependency id used with a ServiceLifecycleProvider
clazz - dependency class
filter - optional OSGi filter String
Returns:
this list builder

getDescriptors

public List<DependencyDescriptor> getDescriptors()
Returns the list of DependencyDescriptors added to this list builder.

Returns:
list of DependencyDescriptors added to this list builder


Copyright © 2011-2012. All Rights Reserved.