org.hibernate.envers.tools
Class Tools
java.lang.Object
org.hibernate.envers.tools.Tools
public class Tools
- extends Object
- Author:
- Adam Warski (adam at warski dot org)
Constructor Summary |
Tools()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Tools
public Tools()
newHashMap
public static <K,V> Map<K,V> newHashMap()
newHashSet
public static <E> Set<E> newHashSet()
newLinkedHashMap
public static <K,V> Map<K,V> newLinkedHashMap()
entitiesEqual
public static boolean entitiesEqual(org.hibernate.engine.SessionImplementor session,
Object obj1,
Object obj2)
getIdentifier
public static Object getIdentifier(org.hibernate.engine.SessionImplementor session,
Object obj)
getTargetFromProxy
public static Object getTargetFromProxy(org.hibernate.engine.SessionFactoryImplementor sessionFactoryImplementor,
org.hibernate.proxy.HibernateProxy proxy)
objectsEqual
public static boolean objectsEqual(Object obj1,
Object obj2)
iteratorToList
public static <T> List<T> iteratorToList(Iterator<T> iter)
iteratorsContentEqual
public static boolean iteratorsContentEqual(Iterator iter1,
Iterator iter2)
listToIndexElementPairList
public static <T> List<Pair<Integer,T>> listToIndexElementPairList(List<T> list)
- Transforms a list of arbitrary elements to a list of index-element pairs.
- Parameters:
list
- List to transform.
- Returns:
- A list of pairs: ((0, element_at_index_0), (1, element_at_index_1), ...)
getProperty
public static String getProperty(Properties properties,
String propertyName,
String legacyPropertyName,
String defaultValue)
- Parameters:
properties
- Properties from which to read.propertyName
- The name of the property.legacyPropertyName
- Legacy name of the property. The value of this property is read if value for
propertyName
is not set.defaultValue
- Default value returned if a value neither for propertyName
or
legacyPropertyName
is set.
- Returns:
- The value of the property, legacy proparty or the default value, if neither of the values are not set.
Copyright © 2002-2009 Red Hat Middleware, LLC. All Rights Reserved