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

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

public class DescriptorBuilder
extends DescriptorListBuilder

Builds a DependencyDescriptor.

Author:
Matthew Stevenson

Constructor Summary
DescriptorBuilder(DescriptorListBuilder listBuilder, String name, Class clazz, DependencyDescriptor.DependencyType type)
           
DescriptorBuilder(String name, Class clazz)
          Begins building a DependencyDescriptor with the give name and class.
 
Method Summary
 DescriptorBuilder dependency(String name, Class clazz)
          Adds a new DependencyDescriptor with the given name and class
 DependencyDescriptor getDescriptor()
           
 List<DependencyDescriptor> getDescriptors()
          Returns the list of DependencyDescriptors added to this list builder.
 DescriptorBuilder optional()
          Sets the dependency type to OPTIONAL.
 DescriptorBuilder required()
          Sets the dependency type to REQUIRED.
 DescriptorBuilder with(Properties props)
           
 DescriptorBuilder with(String filter)
           
 DescriptorBuilder with(String key, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DescriptorBuilder

public DescriptorBuilder(String name,
                         Class clazz)
Begins building a DependencyDescriptor with the give name and class. By default the DependencyType is REQUIRED. Call optional()

Parameters:
name -
clazz -

DescriptorBuilder

public DescriptorBuilder(DescriptorListBuilder listBuilder,
                         String name,
                         Class clazz,
                         DependencyDescriptor.DependencyType type)
Method Detail

getDescriptor

public DependencyDescriptor getDescriptor()

with

public DescriptorBuilder with(String key,
                              String value)

with

public DescriptorBuilder with(String filter)

with

public DescriptorBuilder with(Properties props)

optional

public DescriptorBuilder optional()
Sets the dependency type to OPTIONAL.

Returns:
this

required

public DescriptorBuilder required()
Sets the dependency type to REQUIRED.

Returns:
this

dependency

public DescriptorBuilder dependency(String name,
                                    Class clazz)
Description copied from class: DescriptorListBuilder
Adds a new DependencyDescriptor with the given name and class

Overrides:
dependency in class DescriptorListBuilder
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()
Description copied from class: DescriptorListBuilder
Returns the list of DependencyDescriptors added to this list builder.

Overrides:
getDescriptors in class DescriptorListBuilder
Returns:
list of DependencyDescriptors added to this list builder


Copyright © 2011-2013. All Rights Reserved.