2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.mielecloud.internal.webservice.sse;
15 import java.util.Objects;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
21 * An event emitted by an SSE connection.
23 * @author Björn Lange - Initial Contribution
26 public final class ServerSentEvent {
27 private final String event;
28 private final String data;
30 public ServerSentEvent(String event, String data) {
35 public String getEvent() {
39 public String getData() {
44 public int hashCode() {
45 return Objects.hash(event, data);
49 public boolean equals(@Nullable Object obj) {
56 if (getClass() != obj.getClass()) {
59 ServerSentEvent other = (ServerSentEvent) obj;
60 return Objects.equals(event, other.event) && Objects.equals(data, other.data);