// Path: src/main/java/org/sherlok/mappings/Def.java
// public static final String SEPARATOR = ":";
// 
// Path: src/main/java/org/sherlok/mappings/SherlokException.java
// @JsonPropertyOrder(value = { "when", "message", "object", "remedy", "details" })
// @JsonIgnoreProperties(value = { "stackTrace", "localizedMessage" })
// @JsonInclude(NON_DEFAULT)
// public class SherlokException extends Exception {
//     private static final long serialVersionUID = 2101833257950070947L;
// 
//     public SherlokException() {
//     }
// 
//     public SherlokException(String message) {
//         this._message = message;
//     }
// 
//     public SherlokException(String message, String object) {
//         this._message = message;
//         this.object = object;
//     }
// 
//     /** In which circumstances did something go wrong? */
//     @JsonProperty("when")
//     private String when;
// 
//     /** What went wrong? */
//     @JsonProperty("message")
//     private String _message;
// 
//     /** More details about what went wrong? */
//     private Object details;
// 
//     /** What was the object causing the error? */
//     private String object;
// 
//     /** Suggestion on how to fix the error, if available */
//     private String remedy;
//     /** The REST route, if available */
//     private String route;
// 
//     public String getWhen() {
//         return when;
//     }
// 
//     public SherlokException setWhen(String when) {
//         this.when = when;
//         return this;
//     }
// 
//     public String getMessage() {
//         return _message;
//     }
// 
//     public SherlokException setMessage(String message) {
//         this._message = message;
//         return this;
//     }
// 
//     public Object getDetails() {
//         return details;
//     }
// 
//     public SherlokException setDetails(String details) {
//         this.details = details;
//         return this;
//     }
// 
//     public SherlokException setDetails(StackTraceElement[] elements) {
// 
//         StringBuilder msg = new StringBuilder();
//         for (int i = 0, n = elements.length; i < n && n < 5; i++) {
//             msg.append(elements[i].getFileName() + ":"
//                     + elements[i].getLineNumber() + ">> "
//                     + elements[i].getMethodName() + "(); ");
//         }
//         setDetails(msg.toString().trim());
//         return this;
//     }
// 
//     /**
//      * @param detailsObj
//      *            must be JSON seralizable
//      */
//     public SherlokException setDetails(Object detailsObj) {
//         this.details = detailsObj;
//         return this;
//     }
// 
//     public String getObject() {
//         return object;
//     }
// 
//     public SherlokException setObject(String object) {
//         this.object = object;
//         return this;
//     }
// 
//     public String getRemedy() {
//         return remedy;
//     }
// 
//     public SherlokException setRemedy(String remedy) {
//         this.remedy = remedy;
//         return this;
//     }
// 
//     public SherlokException setRoute(String route) {
//         this.route = route;
//         return this;
//     }
// 
//     public String getRoute() {
//         return route;
//     }
// 
//     /** To display errors nicely as JSON */
//     public Object toJson() {
//         return this;
//     }
// 
//     @Override
//     public String toString() {
//         return (getMessage() != null ? getMessage() : "") //
//                 + (getObject() != null ? " ON OBJECT " + getObject() : "")//
//                 + (getWhen() != null ? " WHEN " + getWhen() : "")//
//                 + (getRoute() != null ? " and ROUTE " + getRoute() : "")//
//                 + (getDetails() != null ? "; DETAILS: " + getDetails() : "")//
//                 + (getRemedy() != null ? "; REMEDY: " + getRemedy() : "");
//     }
// }


import static java.util.regex.Pattern.compile;
import static org.sherlok.mappings.Def.SEPARATOR;
import java.util.regex.Pattern;
import org.sherlok.mappings.SherlokException;

    /** Forbids to access the whole computer through... */
    public static void validatePath(String path) throws SherlokException {
        if (path.indexOf("..") != -1) {
            throw new SherlokException("path '" + path
                    + "' can not contain double dots.");
        }
    }

    /**
     * @param id
     *            the id to validate
     * @param variableName
     *            name is prepended to exception
     * @throws SherlokException
     *             if <code>id</code> contains a single column, or if name or
     *             value is not valid.
     */
    public static void validateId(String id, String variableName)
            throws SherlokException {
        if (id.indexOf(SEPARATOR) == -1) {
            throw new SherlokException(variableName + " '" + id
                    + "' should have the format"//
                    + " {name}:{version}, but no column was found.");

        } else if (id.split(SEPARATOR).length != 2) {
            throw new SherlokException(variableName + " '" + id
                    + "' should have the format"//
                    + " {name}:{version}, but more than one column was found.");
        } else {
// Path: src/main/java/org/sherlok/mappings/Def.java
// public static final String SEPARATOR = ":";
// 
// Path: src/main/java/org/sherlok/mappings/SherlokException.java
// @JsonPropertyOrder(value = { "when", "message", "object", "remedy", "details" })
// @JsonIgnoreProperties(value = { "stackTrace", "localizedMessage" })
// @JsonInclude(NON_DEFAULT)
// public class SherlokException extends Exception {
//     private static final long serialVersionUID = 2101833257950070947L;
// 
//     public SherlokException() {
//     }
// 
//     public SherlokException(String message) {
//         this._message = message;
//     }
// 
//     public SherlokException(String message, String object) {
//         this._message = message;
//         this.object = object;
//     }
// 
//     /** In which circumstances did something go wrong? */
//     @JsonProperty("when")
//     private String when;
// 
//     /** What went wrong? */
//     @JsonProperty("message")
//     private String _message;
// 
//     /** More details about what went wrong? */
//     private Object details;
// 
//     /** What was the object causing the error? */
//     private String object;
// 
//     /** Suggestion on how to fix the error, if available */
//     private String remedy;
//     /** The REST route, if available */
//     private String route;
// 
//     public String getWhen() {
//         return when;
//     }
// 
//     public SherlokException setWhen(String when) {
//         this.when = when;
//         return this;
//     }
// 
//     public String getMessage() {
//         return _message;
//     }
// 
//     public SherlokException setMessage(String message) {
//         this._message = message;
//         return this;
//     }
// 
//     public Object getDetails() {
//         return details;
//     }
// 
//     public SherlokException setDetails(String details) {
//         this.details = details;
//         return this;
//     }
// 
//     public SherlokException setDetails(StackTraceElement[] elements) {
// 
//         StringBuilder msg = new StringBuilder();
//         for (int i = 0, n = elements.length; i < n && n < 5; i++) {
//             msg.append(elements[i].getFileName() + ":"
//                     + elements[i].getLineNumber() + ">> "
//                     + elements[i].getMethodName() + "(); ");
//         }
//         setDetails(msg.toString().trim());
//         return this;
//     }
// 
//     /**
//      * @param detailsObj
//      *            must be JSON seralizable
//      */
//     public SherlokException setDetails(Object detailsObj) {
//         this.details = detailsObj;
//         return this;
//     }
// 
//     public String getObject() {
//         return object;
//     }
// 
//     public SherlokException setObject(String object) {
//         this.object = object;
//         return this;
//     }
// 
//     public String getRemedy() {
//         return remedy;
//     }
// 
//     public SherlokException setRemedy(String remedy) {
//         this.remedy = remedy;
//         return this;
//     }
// 
//     public SherlokException setRoute(String route) {
//         this.route = route;
//         return this;
//     }
// 
//     public String getRoute() {
//         return route;
//     }
// 
//     /** To display errors nicely as JSON */
//     public Object toJson() {
//         return this;
//     }
// 
//     @Override
//     public String toString() {
//         return (getMessage() != null ? getMessage() : "") //
//                 + (getObject() != null ? " ON OBJECT " + getObject() : "")//
//                 + (getWhen() != null ? " WHEN " + getWhen() : "")//
//                 + (getRoute() != null ? " and ROUTE " + getRoute() : "")//
//                 + (getDetails() != null ? "; DETAILS: " + getDetails() : "")//
//                 + (getRemedy() != null ? "; REMEDY: " + getRemedy() : "");
//     }
// }


// Path: src/main/java/org/sherlok/utils/CheckThat.java
import static java.util.regex.Pattern.compile;
import static org.sherlok.mappings.Def.SEPARATOR;
import java.util.regex.Pattern;
import org.sherlok.mappings.SherlokException;


    /** Forbids to access the whole computer through... */
    public static void validatePath(String path) throws SherlokException {
        if (path.indexOf("..") != -1) {
            throw new SherlokException("path '" + path
                    + "' can not contain double dots.");
        }
    }

    /**
     * @param id
     *            the id to validate
     * @param variableName
     *            name is prepended to exception
     * @throws SherlokException
     *             if <code>id</code> contains a single column, or if name or
     *             value is not valid.
     */
    public static void validateId(String id, String variableName)
            throws SherlokException {
        if (id.indexOf(SEPARATOR) == -1) {
            throw new SherlokException(variableName + " '" + id
                    + "' should have the format"//
                    + " {name}:{version}, but no column was found.");

        } else if (id.split(SEPARATOR).length != 2) {
            throw new SherlokException(variableName + " '" + id
                    + "' should have the format"//
                    + " {name}:{version}, but more than one column was found.");
        } else {
            String[] splits = id.split(SEPARATOR);