uk.nominet.catnap.utility
Class CatnapUtility

java.lang.Object
  extended byuk.nominet.catnap.utility.CatnapUtility

public class CatnapUtility
extends java.lang.Object

General utility functions for catnap project.


Constructor Summary
CatnapUtility()
           
 
Method Summary
static boolean areObjectsEqualModEntityDef(java.lang.Object object1, java.lang.Object object2, EntityDef entityDef, Schema schema)
          This checks if the two objects are equal, comparing the fields in the entity definition
static boolean areObjectsPrimitivelyEqualModEntityDef(java.lang.Object object1, java.lang.Object object2, EntityDef entityDef, Schema schema)
          Check whether or not two objects are equal modulo their primitive definition.
static java.lang.String[] convertObjectPathToArray(java.lang.String javaFieldName)
          Convert an object path seperated by . into seperate string entries representing the path.
static java.lang.Object createNewBlankEntity(EntityDef entityDef)
          Create a new blank entity from the entity def.
static boolean doListsContainSameObjects(java.util.List list1, java.util.List list2, EntityDef entityDef, Schema schema)
          Boolean indicator as to whether a list is primitively equal modulo an entity definition.
static java.util.List getPKValuesFromEntity(Schema schema, java.lang.String entityName, java.lang.Object entity)
          Get the pk values defined in the passed entity def from the passed entity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatnapUtility

public CatnapUtility()
Method Detail

getPKValuesFromEntity

public static java.util.List getPKValuesFromEntity(Schema schema,
                                                   java.lang.String entityName,
                                                   java.lang.Object entity)
Get the pk values defined in the passed entity def from the passed entity


areObjectsEqualModEntityDef

public static boolean areObjectsEqualModEntityDef(java.lang.Object object1,
                                                  java.lang.Object object2,
                                                  EntityDef entityDef,
                                                  Schema schema)
This checks if the two objects are equal, comparing the fields in the entity definition

Parameters:
object1 -
object2 -
Returns:

areObjectsPrimitivelyEqualModEntityDef

public static boolean areObjectsPrimitivelyEqualModEntityDef(java.lang.Object object1,
                                                             java.lang.Object object2,
                                                             EntityDef entityDef,
                                                             Schema schema)
Check whether or not two objects are equal modulo their primitive definition. This does not recurse through any related entities.

Parameters:
object1 -
object2 -
entityDef -
schema -
Returns:

doListsContainSameObjects

public static boolean doListsContainSameObjects(java.util.List list1,
                                                java.util.List list2,
                                                EntityDef entityDef,
                                                Schema schema)
Boolean indicator as to whether a list is primitively equal modulo an entity definition. This really just loops through each list item calling are objects primitively equal.

Parameters:
list1 -
list2 -
entityDef -
schema -
Returns:

createNewBlankEntity

public static java.lang.Object createNewBlankEntity(EntityDef entityDef)
Create a new blank entity from the entity def.

Parameters:
entityDef -
Returns:

convertObjectPathToArray

public static java.lang.String[] convertObjectPathToArray(java.lang.String javaFieldName)
Convert an object path seperated by . into seperate string entries representing the path.

Parameters:
javaFieldName -
Returns: