Changes for checkstyle 8.32
[policy/apex-pdp.git] / model / policy-model / src / main / java / org / onap / policy / apex / model / policymodel / concepts / AxStateParamsBuilder.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
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
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.apex.model.policymodel.concepts;
22
23 import java.util.Map;
24 import java.util.Set;
25 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
26 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
27
28 public class AxStateParamsBuilder {
29     private AxReferenceKey key;
30     private AxArtifactKey trigger;
31     private Map<String, AxStateOutput> stateOutputs;
32     private Set<AxArtifactKey> contextAlbumReferenceSet;
33     private AxTaskSelectionLogic taskSelectionLogic;
34     private Map<String, AxStateFinalizerLogic> stateFinalizerLogicMap;
35     private AxArtifactKey defaultTask;
36     private Map<AxArtifactKey, AxStateTaskReference> taskReferenceMap;
37
38     public AxReferenceKey getKey() {
39         return key;
40     }
41
42     public AxArtifactKey getTrigger() {
43         return trigger;
44     }
45
46     public Map<String, AxStateOutput> getStateOutputs() {
47         return stateOutputs;
48     }
49
50     public Set<AxArtifactKey> getContextAlbumReferenceSet() {
51         return contextAlbumReferenceSet;
52     }
53
54     public AxTaskSelectionLogic getTaskSelectionLogic() {
55         return taskSelectionLogic;
56     }
57
58     public Map<String, AxStateFinalizerLogic> getStateFinalizerLogicMap() {
59         return stateFinalizerLogicMap;
60     }
61
62     public AxArtifactKey getDefaultTask() {
63         return defaultTask;
64     }
65
66     public Map<AxArtifactKey, AxStateTaskReference> getTaskReferenceMap() {
67         return taskReferenceMap;
68     }
69
70     /**
71      * Setter method.
72      *
73      * @param key the reference key of the state
74      * @return builder object
75      */
76     public AxStateParamsBuilder key(AxReferenceKey key) {
77         this.key = key;
78         return this;
79     }
80
81     /**
82      * Setter method.
83      *
84      * @param trigger the event that triggers the state
85      * @return builder object
86      */
87     public AxStateParamsBuilder trigger(AxArtifactKey trigger) {
88         this.trigger = trigger;
89         return this;
90     }
91
92     /**
93      * Setter method.
94      *
95      * @param stateOutputs the possible state outputs for the state
96      * @return builder object
97      */
98     public AxStateParamsBuilder stateOutputs(Map<String, AxStateOutput> stateOutputs) {
99         this.stateOutputs = stateOutputs;
100         return this;
101     }
102
103     /**
104      * Setter method.
105      *
106      * @param contextAlbumReferenceSet the context album reference set defines the context that may
107      *                                 be used by Task Selection Logic and State Finalizer Logic in the state
108      * @return builder object
109      */
110     public AxStateParamsBuilder contextAlbumReferenceSet(Set<AxArtifactKey> contextAlbumReferenceSet) {
111         this.contextAlbumReferenceSet = contextAlbumReferenceSet;
112         return this;
113     }
114
115     /**
116      * Setter method.
117      *
118      * @param taskSelectionLogic the task selection logic that selects the task a state executes in
119      *                           an execution cycle
120      * @return builder object
121      */
122     public AxStateParamsBuilder taskSelectionLogic(AxTaskSelectionLogic taskSelectionLogic) {
123         this.taskSelectionLogic = taskSelectionLogic;
124         return this;
125     }
126
127     /**
128      * Setter method.
129      *
130      * @param stateFinalizerLogicMap the state finalizer logic instances that selects the state
131      *                               output to use after a task executes in a state execution cycle
132      * @return builder object
133      */
134     public AxStateParamsBuilder stateFinalizerLogicMap(
135             Map<String, AxStateFinalizerLogic> stateFinalizerLogicMap) {
136         this.stateFinalizerLogicMap = stateFinalizerLogicMap;
137         return this;
138     }
139
140     /**
141      * Setter method.
142      *
143      * @param defaultTask the default task that will execute in a state if Task Selection Logic is
144      *                    not specified
145      * @return builder object
146      */
147     public AxStateParamsBuilder defaultTask(AxArtifactKey defaultTask) {
148         this.defaultTask = defaultTask;
149         return this;
150     }
151
152     /**
153      * Setter method.
154      *
155      * @param taskReferenceMap the task reference map that defines the tasks for the state and how
156      * @return builder object
157      */
158     public AxStateParamsBuilder taskReferenceMap(Map<AxArtifactKey, AxStateTaskReference> taskReferenceMap) {
159         this.taskReferenceMap = taskReferenceMap;
160         return this;
161     }
162 }