Merge "Added STD sim 2.0.0 tests"
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / controllers / PolicyInfo.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 Nordix Foundation
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
21 package org.oransc.policyagent.controllers;
22
23 import io.swagger.annotations.ApiModel;
24 import io.swagger.annotations.ApiModelProperty;
25
26 import org.immutables.gson.Gson;
27
28 @Gson.TypeAdapters
29 @ApiModel(value = "PolicyInfo")
30 public class PolicyInfo {
31
32     @ApiModelProperty(value = "identity of the policy")
33     public String id;
34
35     @ApiModelProperty(value = "name of the policy type")
36     public String type;
37
38     @ApiModelProperty(value = "identity of the target Near-RT RIC")
39     public String ric;
40
41     @ApiModelProperty(value = "the configuration of the policy")
42     public Object json;
43
44     @ApiModelProperty(value = "the name of the service owning the policy")
45     public String service;
46
47     @ApiModelProperty(value = "timestamp, last modification time")
48     public String lastModified;
49
50     PolicyInfo() {
51     }
52
53     public boolean validate() {
54         return id != null && type != null && ric != null && json != null && service != null && lastModified != null;
55     }
56
57 }