1 /*******************************************************************************
2 * Copyright 2016-2017 ZTE, Inc. and others.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************/
16 package org.onap.msb.apiroute.wrapper.dao.service.bean;
18 import com.fasterxml.jackson.annotation.JsonFormat;
19 import lombok.AllArgsConstructor;
21 import lombok.NoArgsConstructor;
24 import java.util.Date;
25 import java.util.HashMap;
31 public class Metadata {
33 private String namespace;
34 private String uid = "";
35 //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
36 //private Date creationTimestamp;
37 // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
38 @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
39 private Date updateTimestamp;
40 private Map labels = new HashMap();
41 //private String[] annotations = new String[]{};
42 private String[] annotations = null;
46 public boolean equals(Object o) {
47 if (this == o) return true;
48 if (o == null || getClass() != o.getClass()) return false;
49 Metadata metadata = (Metadata) o;
50 return Objects.equals(name, metadata.name) &&
51 Objects.equals(namespace, metadata.namespace) &&
52 Objects.equals(uid, metadata.uid) &&
53 //Objects.equals(creationTimestamp, metadata.creationTimestamp) &&
54 Objects.equals(updateTimestamp, metadata.updateTimestamp) &&
55 Objects.equals(labels, metadata.labels) &&
56 Objects.equals(annotations, metadata.annotations);
60 public int hashCode() {
61 //return Objects.hash(name, namespace, uid, creationTimestamp, updateTimestamp, labels, annotations);
62 return Objects.hash(name, namespace, uid, updateTimestamp, labels, annotations);