org.milyn.scribe.register
Class MultiDaoRegister<T>

java.lang.Object
  extended by org.milyn.scribe.register.AbstractDaoRegister<T>
      extended by org.milyn.scribe.register.MultiDaoRegister<T>
All Implemented Interfaces:
DaoRegister<T>

public class MultiDaoRegister<T>
extends AbstractDaoRegister<T>

Enables multiple DaoRegister objects to be used as one DaoRegister. Each DaoRegister gets a name. To get the correct DAO the following name notation is used "{DaoRegister name}.{Dao name}".

A MultiDaoRegister can be created via the static newInstance(Map) method or via the Builder object. The Builder object can be created via it's constructor or the static builder() or builder(Map) methods.

Author:
maurice.zeijen@smies.com

Method Summary
static
<T> org.milyn.scribe.register.MultiDaoRegister.Builder<T>
builder()
          Creates a Builder object that can build a MultiDaoRegister
static
<T> org.milyn.scribe.register.MultiDaoRegister.Builder<T>
builder(Map<String,? extends DaoRegister<T>> map)
          Creates a Builder object that can build a MultiDaoRegister.
 boolean equals(Object obj)
           
 T getDao(String name)
          Returns the DAO with the specified name.
 Map<String,DaoRegister<T>> getDaoRegisterMap()
           
 int hashCode()
           
static
<T> MultiDaoRegister<T>
newInstance(Map<String,? extends DaoRegister<T>> map)
          Creates a new MultiDaoRegister and fills it with the provided map.
 int size()
           
 String toString()
           
 
Methods inherited from class org.milyn.scribe.register.AbstractDaoRegister
getDefaultDao, returnDao
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

newInstance

public static <T> MultiDaoRegister<T> newInstance(Map<String,? extends DaoRegister<T>> map)
Creates a new MultiDaoRegister and fills it with the provided map.

Type Parameters:
T - the type of the DAO
Parameters:
map - the map that fills the new MultiDaoRegister
Returns:
the new MultiDaoRegister

builder

public static <T> org.milyn.scribe.register.MultiDaoRegister.Builder<T> builder()
Creates a Builder object that can build a MultiDaoRegister

Type Parameters:
T - The type of the DAO
Returns:
The builder

builder

public static <T> org.milyn.scribe.register.MultiDaoRegister.Builder<T> builder(Map<String,? extends DaoRegister<T>> map)
Creates a Builder object that can build a MultiDaoRegister. The builder will be instantiated with the provided map.

Type Parameters:
T - The type of the DAO
Parameters:
map - The map that is added to the builder
Returns:
The builder

getDao

public T getDao(String name)
Description copied from interface: DaoRegister
Returns the DAO with the specified name.

Specified by:
getDao in interface DaoRegister<T>
Overrides:
getDao in class AbstractDaoRegister<T>
Parameters:
name - the name of the DAO
Returns:
the DAO with the specified name

size

public int size()

getDaoRegisterMap

public Map<String,DaoRegister<T>> getDaoRegisterMap()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.