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

java.lang.Object
  extended by org.robokind.api.common.lifecycle.utils.DescriptorListBuilder
Direct Known Subclasses:
DescriptorBuilder

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.
DescriptorListBuilder(List<DependencyDescriptor> descriptors)
          Creates a new DescriptorListBuilder with the given descriptors.
 
Method Summary
 DescriptorBuilder dependency(String name, Class clazz)
          Adds a new DependencyDescriptor with the given name and class
 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.


DescriptorListBuilder

public DescriptorListBuilder(List<DependencyDescriptor> descriptors)
Creates a new DescriptorListBuilder with the given descriptors.

Parameters:
descriptors - initial DependencyDescriptor list
Method Detail

dependency

public DescriptorBuilder dependency(String name,
                                    Class clazz)
Adds a new DependencyDescriptor with the given name and class

Parameters:
name - dependency name used within the ManagedService
clazz - dependency class
Returns:
context for describing the dependency further or adding other dependencies

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-2013. All Rights Reserved.