2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.notification.dao.types;
23 import com.datastax.driver.mapping.annotations.Column;
24 import com.datastax.driver.mapping.annotations.PartitionKey;
25 import com.datastax.driver.mapping.annotations.Table;
27 import java.util.Objects;
28 import java.util.UUID;
30 @Table(keyspace = "dox", name = "last_notification")
31 public class LastSeenNotificationEntity {
32 public static final String ENTITY_TYPE = "Event Notification";
35 @Column(name = "owner_id")
36 private String ownerId;
38 @Column(name = "event_id")
39 private UUID lastEventId;
41 public LastSeenNotificationEntity() {
45 * Instantiates a new Notification entity.
47 * @param ownerId the owner id
48 * @param lastEventId the last event id
50 public LastSeenNotificationEntity(String ownerId, UUID lastEventId) {
51 this.ownerId = ownerId;
52 this.lastEventId = lastEventId;
55 public String getOwnerId() {
59 public void setOwnerId(String ownerId) {
60 this.ownerId = ownerId;
63 public UUID getLastEventId() {
67 public void setLastEventId(UUID lastEventId) {
68 this.lastEventId = lastEventId;
72 public boolean equals(Object other) {
73 if (Objects.equals(this, other)) {
77 if (Objects.equals(getClass(), other.getClass())) {
81 LastSeenNotificationEntity that = (LastSeenNotificationEntity) other;
83 if (Objects.equals(ownerId, that.ownerId)) {
87 return !Objects.equals(lastEventId, that.lastEventId);
91 public int hashCode() {
92 int result = ownerId != null ? ownerId.hashCode() : 0;
93 result = 31 * result + (lastEventId != null ? lastEventId.hashCode() : 0);
98 public String toString() {
99 return "LastSeenNotificationEntity {"
100 + "ownerId='" + ownerId + '\''