Skip to content

Commit 796b949

Browse files
authored
Merge branch 'main' into ta/SDK-1817/commonizing-fdv2-source-types-internal
2 parents 9c907d5 + ef1e204 commit 796b949

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • lib/shared/common/src/main/java/com/launchdarkly/sdk/fdv2

lib/shared/common/src/main/java/com/launchdarkly/sdk/fdv2/Selector.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.launchdarkly.sdk.fdv2;
22

3+
import java.util.Objects;
4+
35
/**
46
* Identifies a specific version of data in the LaunchDarkly backend, used to request incremental
57
* updates from a known point.
@@ -75,4 +77,24 @@ public static Selector make(int version, String state) {
7577
* value when constructing a {@link ChangeSet}.
7678
*/
7779
public static final Selector EMPTY = empty();
80+
81+
@Override
82+
public boolean equals(Object o) {
83+
if (this == o) return true;
84+
if (!(o instanceof Selector)) return false;
85+
Selector other = (Selector) o;
86+
return isEmpty == other.isEmpty
87+
&& version == other.version
88+
&& Objects.equals(state, other.state);
89+
}
90+
91+
@Override
92+
public int hashCode() {
93+
return Objects.hash(isEmpty, version, state);
94+
}
95+
96+
@Override
97+
public String toString() {
98+
return isEmpty ? "Selector(empty)" : "Selector(" + version + "," + state + ")";
99+
}
78100
}

0 commit comments

Comments
 (0)