![JAR search and dependency download from the Maven repository](/logo.png)
ch.streamly.domain.ReplayValueImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of streamly-domain Show documentation
Show all versions of streamly-domain Show documentation
Common Domain objects for the streamly librairies.
The newest version!
package ch.streamly.domain;
import java.util.Objects;
/**
* Default implementation of a {@link ReplayValue}
* @param data type
*/
public class ReplayValueImpl implements ReplayValue{
private final boolean isLoopRestart;
private final T value;
ReplayValueImpl(T value) {
this.isLoopRestart = false;
this.value = value;
}
ReplayValueImpl(boolean isLoopRestart, T value) {
this.isLoopRestart = isLoopRestart;
this.value = value;
}
@Override
public boolean isLoopRestart() {
return isLoopRestart;
}
@Override
public T value() {
return value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ReplayValueImpl> that = (ReplayValueImpl>) o;
return isLoopRestart == that.isLoopRestart &&
Objects.equals(value, that.value);
}
@Override
public int hashCode() {
return Objects.hash(isLoopRestart, value);
}
@Override
public String toString() {
return "ReplayValueImpl{" +
"isLoopRestart=" + isLoopRestart +
", value=" + value +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy