Package info.archinnov.achilles.exception

Examples of info.archinnov.achilles.exception.AchillesException


        }
    }

    public static void validateNotEmpty(Collection<?> arg, String message, Object... args) {
        if (arg == null || arg.isEmpty()) {
            throw new AchillesException(format(message, args));
        }
    }
View Full Code Here


        }
    }

    public static void validateNotEmpty(Map<?, ?> arg, String message, Object... args) {
        if (arg == null || arg.isEmpty()) {
            throw new AchillesException(format(message, args));
        }
    }
View Full Code Here

    }

    public static void validateSize(Map<?, ?> arg, int size, String message, Object... args) {
        validateNotEmpty(arg, "The map '%s' should not be empty", args);
        if (arg.size() != size) {
            throw new AchillesException(format(message, args));
        }
    }
View Full Code Here

        }
    }

    public static void validateComparable(Class<?> type, String message, Object... args) {
        if (!Comparable.class.isAssignableFrom(type)) {
            throw new AchillesException(format(message, args));
        }
    }
View Full Code Here

    }

    public static void validateRegExp(String arg, String regexp, String label) {
        validateNotBlank(arg, "The text value '%s' should not be blank", label);
        if (!Pattern.matches(regexp, arg)) {
            throw new AchillesException(format("The property '%s' should match the pattern '%s'", label, regexp));
        }
    }
View Full Code Here

    }

    public static <T> void validateInstanceOf(Object entity, Class<T> targetClass, String message, Object... args) {
        validateNotNull(entity, "Entity '%s' should not be null", entity);
        if (!targetClass.isInstance(entity)) {
            throw new AchillesException(format(message, args));
        }
    }
View Full Code Here

        }
    }

    public static void validateTrue(boolean condition, String message, Object... args) {
        if (!condition) {
            throw new AchillesException(format(message, args));
        }
    }
View Full Code Here

        }
    }

    public static void validateFalse(boolean condition, String message, Object... args) {
        if (condition) {
            throw new AchillesException(format(message, args));
        }
    }
View Full Code Here

    protected Options adaptOptionsForBatch(Options options) {
        Options modifiedOptions = maybeAddTimestampToStatement(options);
        if (!optionsValidator.isOptionsValidForBatch(modifiedOptions)) {
            flushContext = flushContext.duplicateWithNoData(defaultConsistencyLevel);
            throw new AchillesException("Runtime custom Consistency Level and/or async listeners cannot be set for batch mode. Please set the Consistency Levels at batch start with 'startBatch(consistencyLevel)' and async listener using endBatch(...)");
        }
        return modifiedOptions;
    }
View Full Code Here

            ConsistencyLevel consistencyLevel = overrider.getWriteLevel(context);
            BoundStatementWrapper bsWrapper = binder.bindStatementWithOnlyPKInWhereClause(context, psMap.get(tableName),
                    entityMeta.structure().hasOnlyStaticColumns(),consistencyLevel);
            context.pushStatement(bsWrapper);
        } else {
            throw new AchillesException("Cannot find prepared statement for deletion for table '" + tableName + "'");
        }
    }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.exception.AchillesException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.