com.launchdarkly.eventsource.StreamException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of okhttp-eventsource Show documentation
Show all versions of okhttp-eventsource Show documentation
EventSource Implementation built on OkHttp
The newest version!
package com.launchdarkly.eventsource;
import java.util.Objects;
/**
* Base class for all exceptions thrown by {@link EventSource}.
*
* @since 4.0.0
*/
@SuppressWarnings("serial")
public class StreamException extends Exception {
/**
* Base class constructor.
* @param message the event message
*/
protected StreamException(String message) {
super(message);
}
/**
* Base class constructor.
* @param cause a wrapped exception
*/
protected StreamException(Exception cause) {
super(cause);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
StreamException that = (StreamException) o;
return Objects.equals(getMessage(), that.getMessage()) &&
Objects.equals(getCause(), that.getCause());
}
@Override
public int hashCode() {
return Objects.hash(getMessage(), getCause());
}
}