All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.launchdarkly.eventsource.SetRetryDelayEvent Maven / Gradle / Ivy

There is a newer version: 4.1.1
Show newest version
package com.launchdarkly.eventsource;

/**
 * Represents a "retry:" line that was read from the stream. EventSource consumes this
 * internally from EventParser and does not surface it to the caller; therefore the
 * class is package-private.
 */
final class SetRetryDelayEvent implements StreamEvent {
  private final long retryMillis;
  
  SetRetryDelayEvent(long retryMillis) {
    this.retryMillis = retryMillis;
  }
  
  public long getRetryMillis() {
    return retryMillis;
  }
  
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    SetRetryDelayEvent that = (SetRetryDelayEvent) o;
    return retryMillis == that.retryMillis;
  }

  @Override
  public int hashCode() {
    return (int)retryMillis;
  }
  
  @Override
  public String toString() {
    return "SetRetryDelayEvent(" + retryMillis + ")";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy