436624b7d6563fa4ec0c34df54eaea6f6c82a48d
[policy/apex-pdp.git] /
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.context.test.concepts;
22
23 import java.io.Serializable;
24
25 /**
26  * The Class TestContextItem000.
27  */
28 public class TestContextBooleanItem implements Serializable {
29     private static final int HASH_PRIME_1 = 31;
30     private static final int HASH_PRIME_2 = 1231;
31     private static final int HASH_PRIME_3 = 1237;
32
33     private static final long serialVersionUID = 7241008665286367796L;
34
35     private boolean flag = false;
36
37     /**
38      * The Constructor.
39      */
40     public TestContextBooleanItem() {}
41
42     /**
43      * The Constructor.
44      *
45      * @param flag the flag
46      */
47     public TestContextBooleanItem(final Boolean flag) {
48         this.flag = flag;
49     }
50
51     /**
52      * Gets the flag.
53      *
54      * @return the flag
55      */
56     public boolean getFlag() {
57         return flag;
58     }
59
60     /**
61      * Sets the flag.
62      *
63      * @param flag the flag
64      */
65     public void setFlag(final boolean flag) {
66         this.flag = flag;
67     }
68
69     /*
70      * (non-Javadoc)
71      *
72      * @see java.lang.Object#hashCode()
73      */
74     @Override
75     public int hashCode() {
76         final int prime = HASH_PRIME_1;
77         int result = 1;
78         result = prime * result + (flag ? HASH_PRIME_2 : HASH_PRIME_3);
79         return result;
80     }
81
82     /*
83      * (non-Javadoc)
84      *
85      * @see java.lang.Object#equals(java.lang.Object)
86      */
87     @Override
88     public boolean equals(final Object obj) {
89         if (this == obj) {
90             return true;
91         }
92         if (obj == null) {
93             return false;
94         }
95         if (getClass() != obj.getClass()) {
96             return false;
97         }
98         final TestContextBooleanItem other = (TestContextBooleanItem) obj;
99         return flag == other.flag;
100     }
101
102     /*
103      * (non-Javadoc)
104      *
105      * @see java.lang.Object#toString()
106      */
107     @Override
108     public String toString() {
109         return "TestContextItem000 [flag=" + flag + "]";
110     }
111 }