Aharoni, Pavel (pa0916) | 8c70f07 | 2018-11-18 00:07:12 +0200 | [diff] [blame] | 1 | /*-
|
| 2 | * ============LICENSE_START=======================================================
|
| 3 | * OSAM
|
| 4 | * ================================================================================
|
| 5 | * Copyright (C) 2018 AT&T
|
| 6 | * ================================================================================
|
| 7 | * Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 | * you may not use this file except in compliance with the License.
|
| 9 | * You may obtain a copy of the License at
|
| 10 | *
|
| 11 | * http://www.apache.org/licenses/LICENSE-2.0
|
| 12 | *
|
| 13 | * Unless required by applicable law or agreed to in writing, software
|
| 14 | * distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 | * See the License for the specific language governing permissions and
|
| 17 | * limitations under the License.
|
| 18 | * ============LICENSE_END=========================================================
|
| 19 | */
|
| 20 | package org.onap.osam.job.impl;
|
| 21 |
|
| 22 | import org.onap.osam.job.JobType;
|
| 23 |
|
| 24 | import java.util.Map;
|
| 25 | import java.util.Objects;
|
| 26 | import java.util.TreeMap;
|
| 27 |
|
| 28 | public class JobData {
|
| 29 |
|
| 30 | private TreeMap<JobType, Map<String, Object>> commandData;
|
| 31 | private JobSharedData sharedData;
|
| 32 |
|
| 33 | public JobData() {
|
| 34 | commandData = new TreeMap<>();
|
| 35 | sharedData = new JobSharedData();
|
| 36 | }
|
| 37 |
|
| 38 | public JobData(TreeMap<JobType, Map<String, Object>> commandData, JobSharedData sharedData) {
|
| 39 | this.commandData = commandData;
|
| 40 | this.sharedData = sharedData;
|
| 41 | }
|
| 42 |
|
| 43 | public TreeMap<JobType, Map<String, Object>> getCommandData() {
|
| 44 | return commandData;
|
| 45 | }
|
| 46 |
|
| 47 | public void setCommandData(TreeMap<JobType, Map<String, Object>> commandData) {
|
| 48 | this.commandData = commandData;
|
| 49 | }
|
| 50 |
|
| 51 | public JobSharedData getSharedData() {
|
| 52 | return sharedData;
|
| 53 | }
|
| 54 |
|
| 55 | public void setSharedData(JobSharedData sharedData) {
|
| 56 | this.sharedData = sharedData;
|
| 57 | }
|
| 58 |
|
| 59 | @Override
|
| 60 | public boolean equals(Object o) {
|
| 61 | if (this == o) return true;
|
| 62 | if (!(o instanceof JobData)) return false;
|
| 63 | JobData jobData = (JobData) o;
|
| 64 | return Objects.equals(getCommandData(), jobData.getCommandData()) &&
|
| 65 | Objects.equals(getSharedData(), jobData.getSharedData());
|
| 66 | }
|
| 67 |
|
| 68 | @Override
|
| 69 | public int hashCode() {
|
| 70 |
|
| 71 | return Objects.hash(getCommandData(), getSharedData());
|
| 72 | }
|
| 73 | }
|