* commit '13b61b293d89545b193f40535b8f10f10a5fb191': Use factory methods for RestrictionEntry
This commit is contained in:
@@ -8563,8 +8563,9 @@ package android.content {
|
|||||||
ctor public RestrictionEntry(java.lang.String, boolean);
|
ctor public RestrictionEntry(java.lang.String, boolean);
|
||||||
ctor public RestrictionEntry(java.lang.String, java.lang.String[]);
|
ctor public RestrictionEntry(java.lang.String, java.lang.String[]);
|
||||||
ctor public RestrictionEntry(java.lang.String, int);
|
ctor public RestrictionEntry(java.lang.String, int);
|
||||||
ctor public RestrictionEntry(java.lang.String, android.content.RestrictionEntry[], boolean);
|
|
||||||
ctor public RestrictionEntry(android.os.Parcel);
|
ctor public RestrictionEntry(android.os.Parcel);
|
||||||
|
method public static android.content.RestrictionEntry createBundleArrayEntry(java.lang.String, android.content.RestrictionEntry[]);
|
||||||
|
method public static android.content.RestrictionEntry createBundleEntry(java.lang.String, android.content.RestrictionEntry[]);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method public java.lang.String[] getAllSelectedStrings();
|
method public java.lang.String[] getAllSelectedStrings();
|
||||||
method public java.lang.String[] getChoiceEntries();
|
method public java.lang.String[] getChoiceEntries();
|
||||||
|
|||||||
@@ -8795,8 +8795,9 @@ package android.content {
|
|||||||
ctor public RestrictionEntry(java.lang.String, boolean);
|
ctor public RestrictionEntry(java.lang.String, boolean);
|
||||||
ctor public RestrictionEntry(java.lang.String, java.lang.String[]);
|
ctor public RestrictionEntry(java.lang.String, java.lang.String[]);
|
||||||
ctor public RestrictionEntry(java.lang.String, int);
|
ctor public RestrictionEntry(java.lang.String, int);
|
||||||
ctor public RestrictionEntry(java.lang.String, android.content.RestrictionEntry[], boolean);
|
|
||||||
ctor public RestrictionEntry(android.os.Parcel);
|
ctor public RestrictionEntry(android.os.Parcel);
|
||||||
|
method public static android.content.RestrictionEntry createBundleArrayEntry(java.lang.String, android.content.RestrictionEntry[]);
|
||||||
|
method public static android.content.RestrictionEntry createBundleEntry(java.lang.String, android.content.RestrictionEntry[]);
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
method public java.lang.String[] getAllSelectedStrings();
|
method public java.lang.String[] getAllSelectedStrings();
|
||||||
method public java.lang.String[] getChoiceEntries();
|
method public java.lang.String[] getChoiceEntries();
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public class RestrictionEntry implements Parcelable {
|
|||||||
* {@link #TYPE_BUNDLE_ARRAY bundle-array} type, otherwise the type will be set to
|
* {@link #TYPE_BUNDLE_ARRAY bundle-array} type, otherwise the type will be set to
|
||||||
* {@link #TYPE_BUNDLE bundle}.
|
* {@link #TYPE_BUNDLE bundle}.
|
||||||
*/
|
*/
|
||||||
public RestrictionEntry(String key, RestrictionEntry[] restrictionEntries,
|
private RestrictionEntry(String key, RestrictionEntry[] restrictionEntries,
|
||||||
boolean isBundleArray) {
|
boolean isBundleArray) {
|
||||||
mKey = key;
|
mKey = key;
|
||||||
if (isBundleArray) {
|
if (isBundleArray) {
|
||||||
@@ -219,6 +219,29 @@ public class RestrictionEntry implements Parcelable {
|
|||||||
setRestrictions(restrictionEntries);
|
setRestrictions(restrictionEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an entry of type {@link #TYPE_BUNDLE}.
|
||||||
|
* @param key the unique key for this restriction
|
||||||
|
* @param restrictionEntries array of nested restriction entries.
|
||||||
|
* @return the newly created restriction
|
||||||
|
*/
|
||||||
|
public static RestrictionEntry createBundleEntry(String key,
|
||||||
|
RestrictionEntry[] restrictionEntries) {
|
||||||
|
return new RestrictionEntry(key, restrictionEntries, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an entry of type {@link #TYPE_BUNDLE_ARRAY}.
|
||||||
|
* @param key the unique key for this restriction
|
||||||
|
* @param restrictionEntries array of nested restriction entries. The array may only contain
|
||||||
|
* elements of type {@link #TYPE_BUNDLE bundle}.
|
||||||
|
* @return the newly created restriction
|
||||||
|
*/
|
||||||
|
public static RestrictionEntry createBundleArrayEntry(String key,
|
||||||
|
RestrictionEntry[] restrictionEntries) {
|
||||||
|
return new RestrictionEntry(key, restrictionEntries, true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the type for this restriction.
|
* Sets the type for this restriction.
|
||||||
* @param type the type for this restriction.
|
* @param type the type for this restriction.
|
||||||
|
|||||||
Reference in New Issue
Block a user