Changes for checkstyle 8.32
[policy/apex-pdp.git] / testsuites / integration / integration-common / src / main / java / org / onap / policy / apex / context / test / concepts / TestContextDateTzItem.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
4  *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.apex.context.test.concepts;
23
24 import java.io.Serializable;
25 import java.util.TimeZone;
26 import lombok.Data;
27
28 /**
29  * The Class TestContextDateTzItem.
30  */
31 @Data
32 public class TestContextDateTzItem implements Serializable {
33     private static final long serialVersionUID = 5604426823170331706L;
34
35     private TestContextDateItem dateValue = new TestContextDateItem(System.currentTimeMillis());
36     private String tzValue = TimeZone.getTimeZone("Europe/Dublin").getDisplayName();
37     private boolean dst = false;
38
39     /**
40      * The Constructor.
41      */
42     public TestContextDateTzItem() {
43         dst = true;
44     }
45
46     /**
47      * The Constructor.
48      *
49      * @param dateValue the date value
50      * @param tzValue the tz value
51      * @param dst the dst
52      */
53     public TestContextDateTzItem(final TestContextDateItem dateValue, final String tzValue, final boolean dst) {
54         this.dateValue = dateValue;
55         this.tzValue = TimeZone.getTimeZone(tzValue).getDisplayName();
56         this.dst = dst;
57     }
58
59     /**
60      * The Constructor.
61      *
62      * @param original the original
63      */
64     public TestContextDateTzItem(final TestContextDateTzItem original) {
65         this.dateValue = original.dateValue;
66         this.tzValue = original.tzValue;
67         this.dst = original.dst;
68     }
69
70     /**
71      * Sets the TZ value.
72      *
73      * @param tzValue the TZ value
74      */
75     public void setTzValue(final String tzValue) {
76         if (tzValue != null) {
77             this.tzValue = TimeZone.getTimeZone(tzValue).getDisplayName();
78         } else {
79             this.tzValue = null;
80         }
81     }
82 }