diff --git a/app/aem/core/src/main/java/com/cognifide/apm/core/utils/ErrorMessage.java b/app/aem/core/src/main/java/com/cognifide/apm/core/utils/ErrorMessage.java deleted file mode 100644 index 7d5514e4..00000000 --- a/app/aem/core/src/main/java/com/cognifide/apm/core/utils/ErrorMessage.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * ========================LICENSE_START================================= - * AEM Permission Management - * %% - * Copyright (C) 2013 Wunderman Thompson Technology - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ - -package com.cognifide.apm.core.utils; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class ErrorMessage implements ResponseMessage { - - private final String message; - private final List errors; - private final String type = "error"; - - public ErrorMessage(String message, List errors) { - this.message = message; - this.errors = errors; - } - - public static ErrorMessageBuilder errorMessageBuilder(String message) { - return new ErrorMessageBuilder(message); - } - - public static ErrorMessage errorMessage(String message) { - return new ErrorMessageBuilder(message).build(); - } - - public String getMessage() { - return message; - } - - public List getErrors() { - return errors; - } - - public String getType() { - return type; - } - - public static class ErrorMessageBuilder { - - private final String message; - private final List errors = new ArrayList<>(); - - public ErrorMessageBuilder(String message) { - this.message = message; - } - - public ErrorMessageBuilder addError(String error) { - this.errors.add(error); - return this; - } - - public ErrorMessageBuilder addErrors(Collection errors) { - this.errors.addAll(errors); - return this; - } - - public ErrorMessage build() { - return new ErrorMessage(message, errors); - } - } -} diff --git a/app/aem/core/src/main/java/com/cognifide/apm/core/utils/ResponseMessage.java b/app/aem/core/src/main/java/com/cognifide/apm/core/utils/ResponseMessage.java deleted file mode 100644 index 36945941..00000000 --- a/app/aem/core/src/main/java/com/cognifide/apm/core/utils/ResponseMessage.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * ========================LICENSE_START================================= - * AEM Permission Management - * %% - * Copyright (C) 2013 Wunderman Thompson Technology - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ - -package com.cognifide.apm.core.utils; - -public interface ResponseMessage { - - String getType(); -} diff --git a/app/aem/core/src/main/java/com/cognifide/apm/core/utils/SuccessMessage.java b/app/aem/core/src/main/java/com/cognifide/apm/core/utils/SuccessMessage.java deleted file mode 100644 index 4f6e2c82..00000000 --- a/app/aem/core/src/main/java/com/cognifide/apm/core/utils/SuccessMessage.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * ========================LICENSE_START================================= - * AEM Permission Management - * %% - * Copyright (C) 2013 Wunderman Thompson Technology - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ - -package com.cognifide.apm.core.utils; - -import java.util.HashMap; -import java.util.Map; - -public class SuccessMessage extends HashMap implements ResponseMessage { - - public static final String SUCCESS = "success"; - public static final String MESSAGE = "message"; - public static final String TYPE = "type"; - - private SuccessMessage(String message) { - put(MESSAGE, message); - put(TYPE, SUCCESS); - } - - private SuccessMessage(String message, Map properties) { - putAll(properties); - put(MESSAGE, message); - put(TYPE, SUCCESS); - } - - public static SuccessMessage successMessage(String message) { - return new SuccessMessage(message); - } - - public static SuccessMessageBuilder successMessageBuilder(String message) { - return new SuccessMessageBuilder(message); - } - - @Override - public String getType() { - return SUCCESS; - } - - public static class SuccessMessageBuilder { - - private final String message; - private final Map properties = new HashMap<>(); - - SuccessMessageBuilder(String message) { - this.message = message; - } - - public SuccessMessageBuilder addProperty(String key, Object value) { - this.properties.put(key, value); - return this; - } - - public SuccessMessage build() { - return new SuccessMessage(message, properties); - } - } -}