class UpdateHelper {

    public static boolean shouldUpdate(Entity oldEntity, Entity newEntity, String cluster) throws IvoryException {
        Entity oldView = EntityUtil.getClusterView(oldEntity, cluster);
        Entity newView = EntityUtil.getClusterView(newEntity, cluster);
        switch(oldEntity.getEntityType()) {
            case FEED:
                if(EntityUtil.equals(oldView, newView, FEED_FIELDS))
                    return false;
                return true;
                
            case PROCESS:
                if(EntityUtil.equals(oldView, newView, PROCESS_FIELDS))
                    return false;
                return true;
        }
        throw new IllegalArgumentException("Unhandled entity type " + oldEntity.getEntityType());
    }

}