org.lexevs.dao.database.utility
Class DaoUtility

java.lang.Object
  extended by org.lexevs.dao.database.utility.DaoUtility

public class DaoUtility
extends java.lang.Object

The Class DaoUtility.

Author:
Kevin Peterson

Nested Class Summary
static interface DaoUtility.Equality<T>
           
static class DaoUtility.EqualsEquality<T>
           
static class DaoUtility.SortContainer
           
 
Field Summary
static java.util.Map<java.lang.Class<? extends Property>,CodedNodeSet.PropertyType> propertyClassToTypeMap
           
static java.util.Map<java.lang.String,CodedNodeSet.PropertyType> propertyStringToTypeMap
           
static java.util.Map<CodedNodeSet.PropertyType,java.lang.String> propertyTypeToStringMap
           
 
Constructor Summary
DaoUtility()
           
 
Method Summary
static
<T> boolean
contains(java.util.List<T> list, T item, DaoUtility.Equality<T> equality)
           
static boolean containsNulls(java.lang.Object... objectsToCheck)
           
static AbsoluteCodingSchemeVersionReference createAbsoluteCodingSchemeVersionReference(java.lang.String urn, java.lang.String version)
          Creates the absolute coding scheme version reference.
static java.lang.String createKey(AbsoluteCodingSchemeVersionReference ref)
           
static java.lang.String createKey(java.util.List<AbsoluteCodingSchemeVersionReference> refs)
           
static java.lang.String createKey(java.lang.String uri, java.lang.String version)
           
static
<T> java.util.List<T>
createList(java.lang.Class<T> itemClazz, T... items)
          Creates the list.
static
<T> java.util.List<T>
createNonTypedList(T... items)
           
static Text createText(java.lang.String content)
          Creates the text.
static Text createText(java.lang.String content, java.lang.String format)
          Creates the text.
static
<T extends java.io.Serializable>
T
deepClone(T obj)
           
static
<T> java.lang.Iterable<T>
emptyIterableIfNull(java.lang.Iterable<T> iterable)
           
static
<T> java.lang.Iterable<T>
emptyIterableIfNull(T[] iterable)
           
static
<T> boolean
equals(T one, T two, DaoUtility.Equality<T> equality)
           
static java.util.List<URIMap> getAllURIMappings(Mappings mappings)
          Insert into mappings.
static
<T> java.util.List<T>
getDelta(java.util.List<T> base, java.util.List<T> changeSet, DaoUtility.Equality<T> equality)
           
static java.lang.String getEntityDescriptionText(EntityDescription ed)
           
static
<T extends URIMap>
T
getURIMap(CodingScheme cs, java.lang.Class<T> uriMapClass, java.lang.String localId)
           
static void insertIntoMappings(Mappings mappings, URIMap uriMap)
          Insert into mappings.
static java.util.List<java.lang.String> localNameListToString(LocalNameList lnl)
           
static void main(java.lang.String[] args)
          The main method.
static DaoUtility.SortContainer mapMappingSortOptionListToSort(java.util.List<MappingExtension.MappingSortOption> list)
           
static DaoUtility.SortContainer mapSortOptionListToSort(SortOptionList list)
           
static Mappings mergeURIMappings(Mappings mappings1, Mappings mappings2)
           
static java.util.List<java.lang.String> propertyTypeArrayToString(CodedNodeSet.PropertyType[] types)
           
static GraphQuery.CodeNamespacePair toCodeNamespacePair(ConceptReference ref)
           
static java.util.List<GraphQuery.CodeNamespacePair> toCodeNamespacePair(java.util.List<ConceptReference> list)
           
static void updateBean(java.lang.Object changes, java.lang.Object beanToUpdate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyTypeToStringMap

public static java.util.Map<CodedNodeSet.PropertyType,java.lang.String> propertyTypeToStringMap

propertyStringToTypeMap

public static java.util.Map<java.lang.String,CodedNodeSet.PropertyType> propertyStringToTypeMap

propertyClassToTypeMap

public static java.util.Map<java.lang.Class<? extends Property>,CodedNodeSet.PropertyType> propertyClassToTypeMap
Constructor Detail

DaoUtility

public DaoUtility()
Method Detail

mapMappingSortOptionListToSort

public static DaoUtility.SortContainer mapMappingSortOptionListToSort(java.util.List<MappingExtension.MappingSortOption> list)

mapSortOptionListToSort

public static DaoUtility.SortContainer mapSortOptionListToSort(SortOptionList list)

createList

public static <T> java.util.List<T> createList(java.lang.Class<T> itemClazz,
                                               T... items)
Creates the list.

Parameters:
itemClazz - the item clazz
items - the items
Returns:
the list< t>

createNonTypedList

public static <T> java.util.List<T> createNonTypedList(T... items)

toCodeNamespacePair

public static GraphQuery.CodeNamespacePair toCodeNamespacePair(ConceptReference ref)

toCodeNamespacePair

public static java.util.List<GraphQuery.CodeNamespacePair> toCodeNamespacePair(java.util.List<ConceptReference> list)

getEntityDescriptionText

public static java.lang.String getEntityDescriptionText(EntityDescription ed)

createText

public static Text createText(java.lang.String content)
Creates the text.

Parameters:
content - the content
Returns:
the text

deepClone

public static <T extends java.io.Serializable> T deepClone(T obj)

createText

public static Text createText(java.lang.String content,
                              java.lang.String format)
Creates the text.

Parameters:
content - the content
format - the format
Returns:
the text

createAbsoluteCodingSchemeVersionReference

public static AbsoluteCodingSchemeVersionReference createAbsoluteCodingSchemeVersionReference(java.lang.String urn,
                                                                                              java.lang.String version)
Creates the absolute coding scheme version reference.

Parameters:
urn - the urn
version - the version
Returns:
the absolute coding scheme version reference

createKey

public static java.lang.String createKey(java.util.List<AbsoluteCodingSchemeVersionReference> refs)

createKey

public static java.lang.String createKey(java.lang.String uri,
                                         java.lang.String version)

createKey

public static java.lang.String createKey(AbsoluteCodingSchemeVersionReference ref)

insertIntoMappings

public static void insertIntoMappings(Mappings mappings,
                                      URIMap uriMap)
Insert into mappings.

Parameters:
mappings - the mappings
uriMap - the uri map

containsNulls

public static boolean containsNulls(java.lang.Object... objectsToCheck)

updateBean

public static void updateBean(java.lang.Object changes,
                              java.lang.Object beanToUpdate)

getURIMap

public static <T extends URIMap> T getURIMap(CodingScheme cs,
                                             java.lang.Class<T> uriMapClass,
                                             java.lang.String localId)
                                  throws java.lang.SecurityException,
                                         java.lang.NoSuchMethodException,
                                         java.lang.IllegalArgumentException,
                                         java.lang.IllegalAccessException,
                                         java.lang.reflect.InvocationTargetException
Throws:
java.lang.SecurityException
java.lang.NoSuchMethodException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

getAllURIMappings

public static java.util.List<URIMap> getAllURIMappings(Mappings mappings)
Insert into mappings.

Parameters:
mappings - the mappings
uriMap - the uri map

mergeURIMappings

public static Mappings mergeURIMappings(Mappings mappings1,
                                        Mappings mappings2)

localNameListToString

public static java.util.List<java.lang.String> localNameListToString(LocalNameList lnl)

propertyTypeArrayToString

public static java.util.List<java.lang.String> propertyTypeArrayToString(CodedNodeSet.PropertyType[] types)

emptyIterableIfNull

public static <T> java.lang.Iterable<T> emptyIterableIfNull(java.lang.Iterable<T> iterable)

emptyIterableIfNull

public static <T> java.lang.Iterable<T> emptyIterableIfNull(T[] iterable)

getDelta

public static <T> java.util.List<T> getDelta(java.util.List<T> base,
                                             java.util.List<T> changeSet,
                                             DaoUtility.Equality<T> equality)

contains

public static <T> boolean contains(java.util.List<T> list,
                                   T item,
                                   DaoUtility.Equality<T> equality)

equals

public static <T> boolean equals(T one,
                                 T two,
                                 DaoUtility.Equality<T> equality)

main

public static void main(java.lang.String[] args)
The main method.

Parameters:
args - the arguments

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.