org.opends.server.admin
Class InstantiableRelationDefinition.Builder<C extends ConfigurationClient,S extends Configuration>

java.lang.Object
  extended by org.opends.server.admin.RelationDefinition.AbstractBuilder<C,S,InstantiableRelationDefinition<C,S>>
      extended by org.opends.server.admin.InstantiableRelationDefinition.Builder<C,S>
Type Parameters:
C - The type of client managed object configuration that this relation definition refers to.
S - The type of server managed object configuration that this relation definition refers to.
Enclosing class:
InstantiableRelationDefinition<C extends ConfigurationClient,S extends Configuration>

public static final class InstantiableRelationDefinition.Builder<C extends ConfigurationClient,S extends Configuration>
extends RelationDefinition.AbstractBuilder<C,S,InstantiableRelationDefinition<C,S>>

An interface for incrementally constructing instantiable relation definitions.


Constructor Summary
InstantiableRelationDefinition.Builder(AbstractManagedObjectDefinition<?,?> pd, java.lang.String name, java.lang.String pluralName, AbstractManagedObjectDefinition<C,S> cd)
          Creates a new builder which can be used to incrementally build an instantiable relation definition.
 
Method Summary
protected  InstantiableRelationDefinition<C,S> buildInstance(RelationDefinition.Common<C,S> common)
          Build a relation definition based on the properties of this builder.
 void setDefaultManagedObject(java.lang.String name, DefaultManagedObject<? extends C,? extends S> defaultManagedObject)
          Adds the named default managed object to this instantiable relation definition.
 void setNamingProperty(PropertyDefinition<?> namingPropertyDefinition)
          Sets the naming property for the instantiable relation definition.
 
Methods inherited from class org.opends.server.admin.RelationDefinition.AbstractBuilder
getInstance, setOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstantiableRelationDefinition.Builder

public InstantiableRelationDefinition.Builder(AbstractManagedObjectDefinition<?,?> pd,
                                              java.lang.String name,
                                              java.lang.String pluralName,
                                              AbstractManagedObjectDefinition<C,S> cd)
Creates a new builder which can be used to incrementally build an instantiable relation definition.

Parameters:
pd - The parent managed object definition.
name - The name of the relation.
pluralName - The plural name of the relation.
cd - The child managed object definition.
Method Detail

setDefaultManagedObject

public void setDefaultManagedObject(java.lang.String name,
                                    DefaultManagedObject<? extends C,? extends S> defaultManagedObject)
Adds the named default managed object to this instantiable relation definition.

Parameters:
name - The name of the default managed object.
defaultManagedObject - The default managed object.

setNamingProperty

public void setNamingProperty(PropertyDefinition<?> namingPropertyDefinition)
Sets the naming property for the instantiable relation definition.

Parameters:
namingPropertyDefinition - The property of the child managed object definition which should be used for naming, or null if this relation does not use a property for naming.

buildInstance

protected InstantiableRelationDefinition<C,S> buildInstance(RelationDefinition.Common<C,S> common)
Build a relation definition based on the properties of this builder.

Specified by:
buildInstance in class RelationDefinition.AbstractBuilder<C extends ConfigurationClient,S extends Configuration,InstantiableRelationDefinition<C extends ConfigurationClient,S extends Configuration>>
Parameters:
common - The common fields of the new relation definition.
Returns:
The new relation definition.