package com.tinkerpop.blueprints.pgm.util;

/**
 * The ExceptionFactory provides standard exceptions that should be used by all Blueprints implementations.
 * This ensures that the look-and-feel of all implementations are the same in terms of terminology and punctuation.
 *
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class ExceptionFactory {

    // Graph related exceptions

    public static IllegalArgumentException vertexIdCanNotBeNull() {
        return new IllegalArgumentException("Vertex id can not be null");
    }

    public static IllegalArgumentException edgeIdCanNotBeNull() {
        return new IllegalArgumentException("Edge id can not be null");
    }

    public static IllegalArgumentException vertexWithIdAlreadyExists(final Object id) {
        return new IllegalArgumentException("Vertex with id already exists: " + id);
    }

    public static IllegalArgumentException edgeWithIdAlreadyExist(final Object id) {
        return new IllegalArgumentException("Edge with id already exists: " + id);
    }

    // Element related exceptions

    public static IllegalArgumentException propertyKeyIdIsReserved() {
        return new IllegalArgumentException("Property key id is reserved for all elements");
    }

    public static IllegalArgumentException propertyKeyLabelIsReservedForEdges() {
        return new IllegalArgumentException("Property key label is reserved for all edges");
    }

    // IndexableGraph related exceptions

    public static IllegalArgumentException indexAlreadyExists(final String indexName) {
        return new IllegalArgumentException("Index already exists: " + indexName);
    }

    public static IllegalStateException indexDoesNotSupportClass(final String indexName, final Class clazz) {
        return new IllegalStateException(indexName + " does not support class: " + clazz);
    }

    // KeyIndexableGraph related exceptions

    public static IllegalArgumentException classIsNotIndexable(final Class clazz) {
        return new IllegalArgumentException("Class is not indexable: " + clazz);
    }
}

package com.tinkerpop.blueprints.pgm.util;

/**
 * The ExceptionFactory provides standard exceptions that should be used by all Blueprints implementations.
 * This ensures that the look-and-feel of all implementations are the same in terms of terminology and punctuation.
 *
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class ExceptionFactory {

    // Graph related exceptions

    public static IllegalArgumentException vertexIdCanNotBeNull() {
        return new IllegalArgumentException("Vertex id can not be null");
    }

    public static IllegalArgumentException edgeIdCanNotBeNull() {
        return new IllegalArgumentException("Edge id can not be null");
    }

    public static IllegalArgumentException vertexWithIdAlreadyExists(final Object id) {
        return new IllegalArgumentException("Vertex with id already exists: " + id);
    }

    public static IllegalArgumentException edgeWithIdAlreadyExist(final Object id) {
        return new IllegalArgumentException("Edge with id already exists: " + id);
    }

    // Element related exceptions

    public static IllegalArgumentException propertyKeyIdIsReserved() {
        return new IllegalArgumentException("Property key is reserved for all elements: id");
    }

    public static IllegalArgumentException propertyKeyLabelIsReservedForEdges() {
        return new IllegalArgumentException("Property key is reserved for all edges: label");
    }

    // IndexableGraph related exceptions

    public static IllegalArgumentException indexAlreadyExists(final String indexName) {
        return new IllegalArgumentException("Index already exists: " + indexName);
    }

    public static IllegalStateException indexDoesNotSupportClass(final String indexName, final Class clazz) {
        return new IllegalStateException(indexName + " does not support class: " + clazz);
    }

    // KeyIndexableGraph related exceptions

    public static IllegalArgumentException classIsNotIndexable(final Class clazz) {
        return new IllegalArgumentException("Class is not indexable: " + clazz);
    }
}

tweak to utility package structures. touches alot of classes.