2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
20 package org.onap.so.aaisimulator.utils;
22 import java.util.Arrays;
23 import java.util.List;
26 * @author waqas.ikram@ericsson.com
29 public class RequestErrorBuilder {
31 private final ServiceException serviceException = new ServiceException();
33 public RequestErrorBuilder messageId(final String messageId) {
34 this.serviceException.setMessageId(messageId);
38 public RequestErrorBuilder text(final String text) {
39 this.serviceException.setText(text);
43 public RequestErrorBuilder variables(final List<String> variables) {
44 this.serviceException.setVariables(variables);
48 public RequestErrorBuilder variables(final String... variables) {
49 this.serviceException.setVariables(Arrays.asList(variables));
53 public RequestError build() {
54 final RequestError requestError = new RequestError();
55 requestError.setServiceException(serviceException);