2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
\r
8 * =============================================================================
\r
9 * Licensed under the Apache License, Version 2.0 (the "License");
\r
10 * you may not use this file except in compliance with the License.
\r
11 * You may obtain a copy of the License at
\r
13 * http://www.apache.org/licenses/LICENSE-2.0
\r
15 * Unless required by applicable law or agreed to in writing, software
\r
16 * distributed under the License is distributed on an "AS IS" BASIS,
\r
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
18 * See the License for the specific language governing permissions and
\r
19 * limitations under the License.
\r
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
\r
25 package org.openecomp.appc.statemachine.objects;
\r
27 import java.util.ArrayList;
\r
28 import java.util.List;
\r
31 private String stateName;
\r
32 private List<Transition> transitions;
\r
38 public State(String state){
\r
40 this.stateName = state;
\r
41 this.transitions = new ArrayList<>();
\r
45 public int hashCode(){
\r
46 return this.stateName.hashCode();
\r
50 public boolean equals(Object obj){
\r
54 if(!(obj instanceof State)){
\r
57 State state = (State)obj;
\r
58 return this.stateName.equalsIgnoreCase(state.getStateName());
\r
61 public String getStateName(){
\r
65 void addTransition(Transition transition){
\r
66 this.transitions.add(transition);
\r
69 public List<Transition> getTransitions() {
\r
74 public String toString(){
\r
75 return this.stateName;
\r