2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2020 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=========================================================
21 package org.onap.policy.apex.core.engine;
25 import org.onap.policy.common.parameters.BeanValidator;
26 import org.onap.policy.common.parameters.ValidationResult;
27 import org.onap.policy.common.parameters.annotations.NotBlank;
28 import org.onap.policy.common.parameters.annotations.NotNull;
31 * This class provides the configurable parameters for Apex Tasks.
33 * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
37 public class TaskParameters {
40 // If taskId is not specified, then the taskParameter is added to all tasks in the engine.
41 private String taskId;
50 public TaskParameters() {
51 this.name = "taskParameters";
57 * @param key the task parameter key
58 * @param value the task parameter value
59 * @param taskId the task ID of this task parameter
61 public TaskParameters(String key, String value, String taskId) {
69 * Validates the parameters.
71 * @param resultName name of the result
73 * @return the validation result
75 public ValidationResult validate(String resultName) {
76 return new BeanValidator().validateTop(resultName, this);