alexandroid/decompiled/jadx/sources/com/fasterxml/jackson/annotation/JsonIgnoreProperties.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

234 lines
9 KiB
Java

package com.fasterxml.jackson.annotation;
import java.io.Serializable;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@JacksonAnnotation
@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
/* loaded from: classes7.dex */
public @interface JsonIgnoreProperties {
boolean allowGetters() default false;
boolean allowSetters() default false;
boolean ignoreUnknown() default false;
String[] value() default {};
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static class Value implements JacksonAnnotationValue<JsonIgnoreProperties>, Serializable {
protected static final Value EMPTY = new Value(Collections.EMPTY_SET, false, false, false, true);
private static final long serialVersionUID = 1;
protected final boolean _allowGetters;
protected final boolean _allowSetters;
protected final boolean _ignoreUnknown;
protected final Set<String> _ignored;
protected final boolean _merge;
public Value(Set<String> set, boolean z, boolean z2, boolean z3, boolean z4) {
if (set == null) {
this._ignored = Collections.EMPTY_SET;
} else {
this._ignored = set;
}
this._ignoreUnknown = z;
this._allowGetters = z2;
this._allowSetters = z3;
this._merge = z4;
}
private static Set<String> _asSet(String[] strArr) {
if (strArr == null || strArr.length == 0) {
return Collections.EMPTY_SET;
}
HashSet hashSet = new HashSet(strArr.length);
for (String str : strArr) {
hashSet.add(str);
}
return hashSet;
}
private static boolean _empty(Set<String> set, boolean z, boolean z2, boolean z3, boolean z4) {
Value value = EMPTY;
if (z == value._ignoreUnknown && z2 == value._allowGetters && z3 == value._allowSetters && z4 == value._merge) {
return set == null || set.size() == 0;
}
return false;
}
private static boolean _equals(Value value, Value value2) {
return value._ignoreUnknown == value2._ignoreUnknown && value._merge == value2._merge && value._allowGetters == value2._allowGetters && value._allowSetters == value2._allowSetters && value._ignored.equals(value2._ignored);
}
private static Set<String> _merge(Set<String> set, Set<String> set2) {
if (set.isEmpty()) {
return set2;
}
if (set2.isEmpty()) {
return set;
}
HashSet hashSet = new HashSet(set2.size() + set.size());
hashSet.addAll(set);
hashSet.addAll(set2);
return hashSet;
}
public static Value construct(Set<String> set, boolean z, boolean z2, boolean z3, boolean z4) {
return _empty(set, z, z2, z3, z4) ? EMPTY : new Value(set, z, z2, z3, z4);
}
public static Value empty() {
return EMPTY;
}
public static Value forIgnoreUnknown(boolean z) {
return z ? EMPTY.withIgnoreUnknown() : EMPTY.withoutIgnoreUnknown();
}
public static Value forIgnoredProperties(String... strArr) {
return strArr.length == 0 ? EMPTY : EMPTY.withIgnored(_asSet(strArr));
}
public static Value from(JsonIgnoreProperties jsonIgnoreProperties) {
return jsonIgnoreProperties == null ? EMPTY : construct(_asSet(jsonIgnoreProperties.value()), jsonIgnoreProperties.ignoreUnknown(), jsonIgnoreProperties.allowGetters(), jsonIgnoreProperties.allowSetters(), false);
}
public static Value merge(Value value, Value value2) {
return value == null ? value2 : value.withOverrides(value2);
}
public static Value mergeAll(Value... valueArr) {
Value value = null;
for (Value value2 : valueArr) {
if (value2 != null) {
if (value != null) {
value2 = value.withOverrides(value2);
}
value = value2;
}
}
return value;
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
return obj != null && obj.getClass() == getClass() && _equals(this, (Value) obj);
}
public Set<String> findIgnoredForDeserialization() {
return this._allowSetters ? Collections.EMPTY_SET : this._ignored;
}
public Set<String> findIgnoredForSerialization() {
return this._allowGetters ? Collections.EMPTY_SET : this._ignored;
}
public boolean getAllowGetters() {
return this._allowGetters;
}
public boolean getAllowSetters() {
return this._allowSetters;
}
public boolean getIgnoreUnknown() {
return this._ignoreUnknown;
}
public Set<String> getIgnored() {
return this._ignored;
}
public boolean getMerge() {
return this._merge;
}
public int hashCode() {
return this._ignored.size() + (this._ignoreUnknown ? 1 : -3) + (this._allowGetters ? 3 : -7) + (this._allowSetters ? 7 : -11) + (this._merge ? 11 : -13);
}
public Object readResolve() {
return _empty(this._ignored, this._ignoreUnknown, this._allowGetters, this._allowSetters, this._merge) ? EMPTY : this;
}
public String toString() {
return String.format("JsonIgnoreProperties.Value(ignored=%s,ignoreUnknown=%s,allowGetters=%s,allowSetters=%s,merge=%s)", this._ignored, Boolean.valueOf(this._ignoreUnknown), Boolean.valueOf(this._allowGetters), Boolean.valueOf(this._allowSetters), Boolean.valueOf(this._merge));
}
@Override // com.fasterxml.jackson.annotation.JacksonAnnotationValue
public Class<JsonIgnoreProperties> valueFor() {
return JsonIgnoreProperties.class;
}
public Value withAllowGetters() {
return this._allowGetters ? this : construct(this._ignored, this._ignoreUnknown, true, this._allowSetters, this._merge);
}
public Value withAllowSetters() {
return this._allowSetters ? this : construct(this._ignored, this._ignoreUnknown, this._allowGetters, true, this._merge);
}
public Value withIgnoreUnknown() {
return this._ignoreUnknown ? this : construct(this._ignored, true, this._allowGetters, this._allowSetters, this._merge);
}
public Value withIgnored(String... strArr) {
return construct(_asSet(strArr), this._ignoreUnknown, this._allowGetters, this._allowSetters, this._merge);
}
public Value withMerge() {
return this._merge ? this : construct(this._ignored, this._ignoreUnknown, this._allowGetters, this._allowSetters, true);
}
public Value withOverrides(Value value) {
if (value == null || value == EMPTY) {
return this;
}
if (!value._merge) {
return value;
}
if (_equals(this, value)) {
return this;
}
return construct(_merge(this._ignored, value._ignored), this._ignoreUnknown || value._ignoreUnknown, this._allowGetters || value._allowGetters, this._allowSetters || value._allowSetters, true);
}
public Value withoutAllowGetters() {
return !this._allowGetters ? this : construct(this._ignored, this._ignoreUnknown, false, this._allowSetters, this._merge);
}
public Value withoutAllowSetters() {
return !this._allowSetters ? this : construct(this._ignored, this._ignoreUnknown, this._allowGetters, false, this._merge);
}
public Value withoutIgnoreUnknown() {
return !this._ignoreUnknown ? this : construct(this._ignored, false, this._allowGetters, this._allowSetters, this._merge);
}
public Value withoutIgnored() {
return construct(null, this._ignoreUnknown, this._allowGetters, this._allowSetters, this._merge);
}
public Value withoutMerge() {
return !this._merge ? this : construct(this._ignored, this._ignoreUnknown, this._allowGetters, this._allowSetters, false);
}
public static Value forIgnoredProperties(Set<String> set) {
return EMPTY.withIgnored(set);
}
public Value withIgnored(Set<String> set) {
return construct(set, this._ignoreUnknown, this._allowGetters, this._allowSetters, this._merge);
}
}
}