package org.bench4q.share.helper;

/**
 * 
 * @author coderfengyun
 * 
 */
public class ExceptionUtils {
	public static class EntityUniqueAlReadyExistException extends Exception {
		private static final long serialVersionUID = 8666833843441862022L;
		private String msg;

		private String getMsg() {
			return msg;
		}

		private void setMsg(String msg) {
			this.msg = msg;
		}

		public EntityUniqueAlReadyExistException(String message) {
			this.setMsg(message);
		}

		@Override
		public String getMessage() {
			return this.getMsg();
		}

	}

	public static class UserAlreadyExistException extends Exception {
		private static final long serialVersionUID = -5465994901904292643L;

		@Override
		public String getMessage() {
			return "The User Already exists!";
		}
	}

	public static class MultiUserWithSameUserNameExist extends Exception {
		private static final long serialVersionUID = 1L;

		@Override
		public String getMessage() {
			return "Multi users exist with the same userName!";
		}
	}

	public static class TransactionCommitException extends Exception {
		private static final long serialVersionUID = -6104657204412644717L;

		@Override
		public String getMessage() {
			return "Transaction commit fails!";
		}
	}

	public static class IllegalParameterException extends Exception {
		private static final long serialVersionUID = -4999157899142651582L;
		private String msg;

		public IllegalParameterException(String msg) {
			this.msg = msg;
		}

		@Override
		public String getMessage() {
			return this.msg;
		}

	}
}
