Revert "Allow flags to add metadata directly in code."
Revert submission 23727772-b279054964-flag-api-udc-qpr-dev Reason for revert: b/290929382 Reverted changes: /q/submissionid:23727772-b279054964-flag-api-udc-qpr-dev Change-Id: I328c83d38cfc4afd03dcba759234777db41bb4a8
This commit is contained in:
committed by
Android (Google) Code Review
parent
8f91c5d73c
commit
d7d04dccb9
@@ -43,10 +43,4 @@ public class BooleanFlag extends BooleanFlagBase {
|
||||
public Boolean getDefault() {
|
||||
return mDefault;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BooleanFlag defineMetaData(String label, String description, String categoryName) {
|
||||
super.defineMetaData(label, description, categoryName);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,6 @@ abstract class BooleanFlagBase implements Flag<Boolean> {
|
||||
|
||||
private final String mNamespace;
|
||||
private final String mName;
|
||||
private String mLabel;
|
||||
private String mDescription;
|
||||
private String mCategoryName;
|
||||
|
||||
/**
|
||||
* @param namespace A namespace for this flag. See {@link android.provider.DeviceConfig}.
|
||||
@@ -33,7 +30,6 @@ abstract class BooleanFlagBase implements Flag<Boolean> {
|
||||
BooleanFlagBase(String namespace, String name) {
|
||||
mNamespace = namespace;
|
||||
mName = name;
|
||||
mLabel = name;
|
||||
}
|
||||
|
||||
public abstract Boolean getDefault();
|
||||
@@ -50,30 +46,6 @@ abstract class BooleanFlagBase implements Flag<Boolean> {
|
||||
return mName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BooleanFlagBase defineMetaData(String label, String description, String categoryName) {
|
||||
mLabel = label;
|
||||
mDescription = description;
|
||||
mCategoryName = categoryName;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public String getLabel() {
|
||||
return mLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return mDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategoryName() {
|
||||
return mCategoryName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public String toString() {
|
||||
|
||||
@@ -41,10 +41,4 @@ public class DynamicBooleanFlag extends BooleanFlagBase implements DynamicFlag<B
|
||||
public Boolean getDefault() {
|
||||
return mDefault;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicBooleanFlag defineMetaData(String label, String description, String categoryName) {
|
||||
super.defineMetaData(label, description, categoryName);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,41 +42,4 @@ public interface Flag<T> {
|
||||
default boolean isDynamic() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add human-readable details to the flag. Flag client's are not required to set this.
|
||||
*
|
||||
* See {@link #getLabel()}, {@link #getDescription()}, and {@link #getCategoryName()}.
|
||||
*
|
||||
* @return Returns `this`, to make a fluent api.
|
||||
*/
|
||||
Flag<T> defineMetaData(String label, String description, String categoryName);
|
||||
|
||||
/**
|
||||
* A human-readable name for the flag. Defaults to {@link #getName()}
|
||||
*
|
||||
* See {@link #defineMetaData(String, String, String)}
|
||||
*/
|
||||
@NonNull
|
||||
default String getLabel() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* A human-readable description for the flag. Defaults to null if unset.
|
||||
*
|
||||
* See {@link #defineMetaData(String, String, String)}
|
||||
*/
|
||||
default String getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* A human-readable category name for the flag. Defaults to null if unset.
|
||||
*
|
||||
* See {@link #defineMetaData(String, String, String)}
|
||||
*/
|
||||
default String getCategoryName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,4 @@ public final class FusedOffFlag extends BooleanFlagBase {
|
||||
public Boolean getDefault() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FusedOffFlag defineMetaData(String label, String description, String categoryName) {
|
||||
super.defineMetaData(label, description, categoryName);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,4 @@ public final class FusedOnFlag extends BooleanFlagBase {
|
||||
public Boolean getDefault() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FusedOnFlag defineMetaData(String label, String description, String categoryName) {
|
||||
super.defineMetaData(label, description, categoryName);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user