8ca5912fab424fd50e89de203da55fc24410fe84
[policy/apex-pdp.git] / client / client-editor / src / main / java / org / onap / policy / apex / client / editor / rest / handling / bean / BeanState.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. 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.client.editor.rest.handling.bean;
22
23 import java.util.Arrays;
24 import java.util.Map;
25
26 import javax.xml.bind.annotation.XmlType;
27
28 /**
29  * The State Bean.
30  */
31 @XmlType
32 public class BeanState extends BeanBase {
33
34     private String name = null;
35     private BeanKeyRef trigger = null;
36     private BeanKeyRef defaultTask = null;
37     private BeanKeyRef[] contexts = null;
38     private BeanLogic taskSelectionLogic = null;
39     private Map<String, BeanStateTaskRef> tasks = null;
40     private Map<String, BeanLogic> finalizers = null;
41     private Map<String, BeanStateOutput> stateOutputs = null;
42
43     /**
44      * Gets the name.
45      *
46      * @return the name
47      */
48     public String getName() {
49         return name;
50     }
51
52     /**
53      * Gets the trigger.
54      *
55      * @return the trigger
56      */
57     public BeanKeyRef getTrigger() {
58         return trigger;
59     }
60
61     /**
62      * Gets the contexts.
63      *
64      * @return the contexts
65      */
66     public BeanKeyRef[] getContexts() {
67         return contexts;
68     }
69
70     /**
71      * Gets the task selection logic.
72      *
73      * @return the task selection logic
74      */
75     public BeanLogic getTaskSelectionLogic() {
76         return taskSelectionLogic;
77     }
78
79     /**
80      * Gets the tasks.
81      *
82      * @return the tasks
83      */
84     public Map<String, BeanStateTaskRef> getTasks() {
85         return tasks;
86     }
87
88     /**
89      * Gets the finalizers.
90      *
91      * @return the finalizers
92      */
93     public Map<String, BeanLogic> getFinalizers() {
94         return finalizers;
95     }
96
97     /**
98      * Gets the state outputs.
99      *
100      * @return the state outputs
101      */
102     public Map<String, BeanStateOutput> getStateOutputs() {
103         return stateOutputs;
104     }
105
106     /**
107      * Gets the default task.
108      *
109      * @return the default task
110      */
111     public BeanKeyRef getDefaultTask() {
112         return defaultTask;
113     }
114
115     /**
116      * Sets the default task.
117      *
118      * @param defaultTask the new default task
119      */
120     public void setDefaultTask(final BeanKeyRef defaultTask) {
121         this.defaultTask = defaultTask;
122     }
123
124     /**
125      * {@inheritDoc}.
126      */
127     @Override
128     public String toString() {
129         return "State [name=" + name + ", trigger=" + trigger + ", defaultTask=" + defaultTask + ", contexts="
130                 + Arrays.toString(contexts) + ", taskSelectionLogic=" + taskSelectionLogic + ", tasks=" + tasks
131                 + ", finalizers=" + finalizers + ", stateOutputs=" + stateOutputs + "]";
132     }
133
134 }