37bb4041edb0cd9dce0a8ad4f456fd3b7d08c2d3
[optf/cmso.git] /
1 /*******************************************************************************
2  *
3  * Copyright © 2019 AT&T Intellectual Property.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6  * in compliance with the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software distributed under the License
11  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12  * or implied. See the License for the specific language governing permissions and limitations under
13  * the License.
14  *
15  *
16  * Unless otherwise specified, all documentation contained herein is licensed under the Creative
17  * Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except
18  * in compliance with the License. You may obtain a copy of the License at
19  *
20  * https://creativecommons.org/licenses/by/4.0/
21  *
22  * Unless required by applicable law or agreed to in writing, documentation distributed under the
23  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
24  * express or implied. See the License for the specific language governing permissions and
25  * limitations under the License.
26  ******************************************************************************/
27
28 package org.onap.optf.cmso.optimizer.service.rs.models;
29
30 import com.att.eelf.configuration.EELFLogger;
31 import com.att.eelf.configuration.EELFManager;
32 import com.fasterxml.jackson.core.JsonProcessingException;
33 import com.fasterxml.jackson.databind.ObjectMapper;
34 import io.swagger.annotations.ApiModel;
35 import io.swagger.annotations.ApiModelProperty;
36 import java.io.Serializable;
37 import java.util.ArrayList;
38 import java.util.List;
39
40 @ApiModel(value = "Optimizer Schedule Info", description = "Schedule Information returned from optimizer request.")
41 public class OptimizerScheduleInfo implements Serializable {
42     private static final long serialVersionUID = 1L;
43     private static EELFLogger log = EELFManager.getInstance().getLogger(OptimizerScheduleInfo.class);
44
45     @ApiModelProperty(value = "Lists of elements with start times.")
46     private List<ScheduledElement> scheduledElements = new ArrayList<>();
47
48     @ApiModelProperty(value = "Lists of elements that were not able to be scheduled.")
49     private List<UnScheduledElement> unScheduledElements = new ArrayList<>();
50
51
52     public List<ScheduledElement> getScheduledElements() {
53         return scheduledElements;
54     }
55
56
57     public void setScheduledElements(List<ScheduledElement> scheduledElements) {
58         this.scheduledElements = scheduledElements;
59     }
60
61
62     public List<UnScheduledElement> getUnScheduledElements() {
63         return unScheduledElements;
64     }
65
66
67     public void setUnScheduledElements(List<UnScheduledElement> unScheduledElements) {
68         this.unScheduledElements = unScheduledElements;
69     }
70
71
72     @Override
73     public String toString() {
74         ObjectMapper mapper = new ObjectMapper();
75         try {
76             return mapper.writeValueAsString(this);
77         } catch (JsonProcessingException e) {
78             log.debug("Error in toString()", e);
79         }
80         return "";
81     }
82 }