11package com .launchdarkly .client ;
22
3+ import com .google .common .collect .ImmutableList ;
4+
35/**
46 * The descriptor for a specific kind of {@link VersionedData} objects that may exist in a {@link FeatureStore}.
7+ * You will not need to refer to this type unless you are directly manipulating a {@code FeatureStore}
8+ * or writing your own {@code FeatureStore} implementation. If you are implementing a custom store, for
9+ * maximum forward compatibility you should only refer to {@link VersionedData}, {@link VersionedDataKind},
10+ * and {@link VersionedDataKind#ALL}, and avoid any dependencies on specific type descriptor instances
11+ * or any specific fields of the types they describe.
512 * @since 3.0.0
613 */
714public abstract class VersionedDataKind <T extends VersionedData > {
@@ -41,7 +48,9 @@ String getKeyFromStreamApiPath(String path) {
4148 return path .startsWith (getStreamApiPath ()) ? path .substring (getStreamApiPath ().length ()) : null ;
4249 }
4350
44-
51+ /**
52+ * The {@link VersionedDataKind} instance that describes feature flag data.
53+ */
4554 public static VersionedDataKind <FeatureFlag > FEATURES = new VersionedDataKind <FeatureFlag >() {
4655
4756 public String getNamespace () {
@@ -61,6 +70,9 @@ public FeatureFlag makeDeletedItem(String key, int version) {
6170 }
6271 };
6372
73+ /**
74+ * The {@link VersionedDataKind} instance that describes user segment data.
75+ */
6476 public static VersionedDataKind <Segment > SEGMENTS = new VersionedDataKind <Segment >() {
6577
6678 public String getNamespace () {
@@ -79,4 +91,10 @@ public Segment makeDeletedItem(String key, int version) {
7991 return new Segment .Builder (key ).deleted (true ).version (version ).build ();
8092 }
8193 };
94+
95+ /**
96+ * A list of all existing instances of {@link VersionedDataKind}.
97+ * @since 4.1.0
98+ */
99+ public static Iterable <VersionedDataKind <?>> ALL = ImmutableList .of (FEATURES , SEGMENTS );
82100}
0 commit comments