| /** |
| * Copyright (c) 2018 CEA. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * CEA - initial API and implementation and/or initial documentation |
| */ |
| package org.eclipse.sensinact.studio.http.messages.snamessage; |
| |
| /** |
| * @author Etienne Gandrille |
| */ |
| public abstract class MsgNotification<V> extends MsgSensinact { |
| |
| protected V notification; |
| |
| public MsgNotification(String type) { |
| super(type); |
| } |
| |
| public V getNotification() { |
| return notification; |
| } |
| |
| public void setNotification(V notification) { |
| this.notification = notification; |
| } |
| |
| @Override |
| public int hashCode() { |
| final int prime = 31; |
| int result = 1; |
| result = prime * result + ((notification == null) ? 0 : notification.hashCode()); |
| result = prime * result + ((type == null) ? 0 : type.hashCode()); |
| result = prime * result + ((uri == null) ? 0 : uri.hashCode()); |
| return result; |
| } |
| |
| @Override |
| public boolean equals(Object obj) { |
| if (this == obj) |
| return true; |
| if (obj == null) |
| return false; |
| if (getClass() != obj.getClass()) |
| return false; |
| MsgNotification<?> other = (MsgNotification<?>) obj; |
| if (notification == null) { |
| if (other.notification != null) |
| return false; |
| } else if (!notification.equals(other.notification)) |
| return false; |
| if (type == null) { |
| if (other.type != null) |
| return false; |
| } else if (!type.equals(other.type)) |
| return false; |
| if (uri == null) { |
| if (other.uri != null) |
| return false; |
| } else if (!uri.equals(other.uri)) |
| return false; |
| return true; |
| } |
| } |