mark methods as @JsonIgnore to avoid Jackson serializing them

This commit is contained in:
Aria Moradi
2021-08-05 03:31:32 +04:30
parent c7112ec67f
commit 67ec9ccc4e
2 changed files with 13 additions and 1 deletions

View File

@@ -9,9 +9,11 @@ package androidx.preference;
import android.content.Context;
import android.text.TextUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class ListPreference extends Preference {
// reference: https://android.googlesource.com/platform/frameworks/support/+/996971f962fcd554339a7cb2859cef9ca89dbcb7/preference/preference/src/main/java/androidx/preference/ListPreference.java
// Note: remove @JsonIgnore and implement methods if any extension ever uses these methods or the variables behind them
private CharSequence[] entries;
private CharSequence[] entryValues;
@@ -47,10 +49,13 @@ public class ListPreference extends Preference {
this.entryValues = entryValues;
}
@JsonIgnore
public void setValueIndex(int index) { throw new RuntimeException("Stub!"); }
@JsonIgnore
public String getValue() { throw new RuntimeException("Stub!"); }
@JsonIgnore
public void setValue(String value) { throw new RuntimeException("Stub!"); }
/** Tachidesk specific API */

View File

@@ -8,24 +8,31 @@ package androidx.preference;
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import android.content.Context;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Set;
public class MultiSelectListPreference extends DialogPreference {
// Note: remove @JsonIgnore and implement methods if any extension ever uses these methods or the variables behind them
public MultiSelectListPreference(Context context) { super(context); }
@JsonIgnore
public void setEntries(CharSequence[] entries) { throw new RuntimeException("Stub!"); }
@JsonIgnore
public CharSequence[] getEntries() { throw new RuntimeException("Stub!"); }
@JsonIgnore
public void setEntryValues(CharSequence[] entryValues) { throw new RuntimeException("Stub!"); }
@JsonIgnore
public CharSequence[] getEntryValues() { throw new RuntimeException("Stub!"); }
@JsonIgnore
public void setValues(Set<String> values) { throw new RuntimeException("Stub!"); }
@JsonIgnore
public Set<String> getValues() { throw new RuntimeException("Stub!"); }
public int findIndexOfValue(String value) { throw new RuntimeException("Stub!"); }