mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-13 17:37:16 +01:00
475 lines
14 KiB
Java
475 lines
14 KiB
Java
package com.fasterxml.jackson.databind;
|
|
|
|
import com.fasterxml.jackson.core.JsonPointer;
|
|
import com.fasterxml.jackson.core.TreeNode;
|
|
import com.fasterxml.jackson.databind.JsonSerializable;
|
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
import com.fasterxml.jackson.databind.node.JsonNodeType;
|
|
import com.fasterxml.jackson.databind.node.MissingNode;
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
import com.fasterxml.jackson.databind.util.ClassUtil;
|
|
import java.io.IOException;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigInteger;
|
|
import java.util.Collections;
|
|
import java.util.Comparator;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Optional;
|
|
import java.util.Set;
|
|
import java.util.function.BiConsumer;
|
|
import java.util.stream.Stream;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes7.dex */
|
|
public abstract class JsonNode extends JsonSerializable.Base implements TreeNode, Iterable<JsonNode> {
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* renamed from: com.fasterxml.jackson.databind.JsonNode$1, reason: invalid class name */
|
|
public static /* synthetic */ class AnonymousClass1 {
|
|
static final /* synthetic */ int[] $SwitchMap$com$fasterxml$jackson$databind$node$JsonNodeType;
|
|
|
|
static {
|
|
int[] iArr = new int[JsonNodeType.values().length];
|
|
$SwitchMap$com$fasterxml$jackson$databind$node$JsonNodeType = iArr;
|
|
try {
|
|
iArr[JsonNodeType.ARRAY.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$fasterxml$jackson$databind$node$JsonNodeType[JsonNodeType.OBJECT.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$fasterxml$jackson$databind$node$JsonNodeType[JsonNodeType.MISSING.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum OverwriteMode {
|
|
NONE,
|
|
NULLS,
|
|
SCALARS,
|
|
ALL
|
|
}
|
|
|
|
public abstract JsonNode _at(JsonPointer jsonPointer);
|
|
|
|
public <T> T _reportRequiredViolation(String str, Object... objArr) {
|
|
throw new IllegalArgumentException(String.format(str, objArr));
|
|
}
|
|
|
|
public boolean asBoolean() {
|
|
return asBoolean(false);
|
|
}
|
|
|
|
public double asDouble() {
|
|
return asDouble(0.0d);
|
|
}
|
|
|
|
public int asInt() {
|
|
return asInt(0);
|
|
}
|
|
|
|
public long asLong() {
|
|
return asLong(0L);
|
|
}
|
|
|
|
public Optional<JsonNode> asOptional() {
|
|
return Optional.of(this);
|
|
}
|
|
|
|
public abstract String asText();
|
|
|
|
public String asText(String str) {
|
|
String asText = asText();
|
|
return asText == null ? str : asText;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public final JsonNode at(JsonPointer jsonPointer) {
|
|
if (jsonPointer.matches()) {
|
|
return this;
|
|
}
|
|
JsonNode _at = _at(jsonPointer);
|
|
return _at == null ? MissingNode.getInstance() : _at.at(jsonPointer.tail());
|
|
}
|
|
|
|
public BigInteger bigIntegerValue() {
|
|
return BigInteger.ZERO;
|
|
}
|
|
|
|
public byte[] binaryValue() throws IOException {
|
|
return null;
|
|
}
|
|
|
|
public boolean booleanValue() {
|
|
return false;
|
|
}
|
|
|
|
public boolean canConvertToExactIntegral() {
|
|
return isIntegralNumber();
|
|
}
|
|
|
|
public boolean canConvertToInt() {
|
|
return false;
|
|
}
|
|
|
|
public boolean canConvertToLong() {
|
|
return false;
|
|
}
|
|
|
|
public BigDecimal decimalValue() {
|
|
return BigDecimal.ZERO;
|
|
}
|
|
|
|
public abstract <T extends JsonNode> T deepCopy();
|
|
|
|
public double doubleValue() {
|
|
return 0.0d;
|
|
}
|
|
|
|
public Iterator<JsonNode> elements() {
|
|
return ClassUtil.emptyIterator();
|
|
}
|
|
|
|
public abstract boolean equals(Object obj);
|
|
|
|
public boolean equals(Comparator<JsonNode> comparator, JsonNode jsonNode) {
|
|
return comparator.compare(this, jsonNode) == 0;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public Iterator<String> fieldNames() {
|
|
return ClassUtil.emptyIterator();
|
|
}
|
|
|
|
@Deprecated
|
|
public Iterator<Map.Entry<String, JsonNode>> fields() {
|
|
return ClassUtil.emptyIterator();
|
|
}
|
|
|
|
public abstract JsonNode findParent(String str);
|
|
|
|
public final List<JsonNode> findParents(String str) {
|
|
List<JsonNode> findParents = findParents(str, null);
|
|
return findParents == null ? Collections.EMPTY_LIST : findParents;
|
|
}
|
|
|
|
public abstract List<JsonNode> findParents(String str, List<JsonNode> list);
|
|
|
|
public abstract JsonNode findPath(String str);
|
|
|
|
public abstract JsonNode findValue(String str);
|
|
|
|
public final List<JsonNode> findValues(String str) {
|
|
List<JsonNode> findValues = findValues(str, null);
|
|
return findValues == null ? Collections.EMPTY_LIST : findValues;
|
|
}
|
|
|
|
public abstract List<JsonNode> findValues(String str, List<JsonNode> list);
|
|
|
|
public final List<String> findValuesAsText(String str) {
|
|
List<String> findValuesAsText = findValuesAsText(str, null);
|
|
return findValuesAsText == null ? Collections.EMPTY_LIST : findValuesAsText;
|
|
}
|
|
|
|
public abstract List<String> findValuesAsText(String str, List<String> list);
|
|
|
|
public float floatValue() {
|
|
return 0.0f;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public abstract JsonNode get(int i);
|
|
|
|
public abstract JsonNodeType getNodeType();
|
|
|
|
public boolean has(String str) {
|
|
return get(str) != null;
|
|
}
|
|
|
|
public boolean hasNonNull(String str) {
|
|
JsonNode jsonNode = get(str);
|
|
return (jsonNode == null || jsonNode.isNull()) ? false : true;
|
|
}
|
|
|
|
public int intValue() {
|
|
return 0;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public boolean isArray() {
|
|
return false;
|
|
}
|
|
|
|
public boolean isBigDecimal() {
|
|
return false;
|
|
}
|
|
|
|
public boolean isBigInteger() {
|
|
return false;
|
|
}
|
|
|
|
public final boolean isBinary() {
|
|
return getNodeType() == JsonNodeType.BINARY;
|
|
}
|
|
|
|
public final boolean isBoolean() {
|
|
return getNodeType() == JsonNodeType.BOOLEAN;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public final boolean isContainerNode() {
|
|
JsonNodeType nodeType = getNodeType();
|
|
return nodeType == JsonNodeType.OBJECT || nodeType == JsonNodeType.ARRAY;
|
|
}
|
|
|
|
public boolean isDouble() {
|
|
return false;
|
|
}
|
|
|
|
public boolean isEmpty() {
|
|
return size() == 0;
|
|
}
|
|
|
|
public boolean isFloat() {
|
|
return false;
|
|
}
|
|
|
|
public boolean isFloatingPointNumber() {
|
|
return false;
|
|
}
|
|
|
|
public boolean isInt() {
|
|
return false;
|
|
}
|
|
|
|
public boolean isIntegralNumber() {
|
|
return false;
|
|
}
|
|
|
|
public boolean isLong() {
|
|
return false;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public boolean isMissingNode() {
|
|
return false;
|
|
}
|
|
|
|
public final boolean isNull() {
|
|
return getNodeType() == JsonNodeType.NULL;
|
|
}
|
|
|
|
public final boolean isNumber() {
|
|
return getNodeType() == JsonNodeType.NUMBER;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public boolean isObject() {
|
|
return false;
|
|
}
|
|
|
|
public final boolean isPojo() {
|
|
return getNodeType() == JsonNodeType.POJO;
|
|
}
|
|
|
|
public boolean isShort() {
|
|
return false;
|
|
}
|
|
|
|
public final boolean isTextual() {
|
|
return getNodeType() == JsonNodeType.STRING;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public final boolean isValueNode() {
|
|
int i = AnonymousClass1.$SwitchMap$com$fasterxml$jackson$databind$node$JsonNodeType[getNodeType().ordinal()];
|
|
return (i == 1 || i == 2 || i == 3) ? false : true;
|
|
}
|
|
|
|
@Override // java.lang.Iterable
|
|
public final Iterator<JsonNode> iterator() {
|
|
return elements();
|
|
}
|
|
|
|
public long longValue() {
|
|
return 0L;
|
|
}
|
|
|
|
public Number numberValue() {
|
|
return null;
|
|
}
|
|
|
|
public Optional<JsonNode> optional(int i) {
|
|
return Optional.empty();
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public abstract JsonNode path(int i);
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public abstract JsonNode path(String str);
|
|
|
|
public Set<Map.Entry<String, JsonNode>> properties() {
|
|
return Collections.EMPTY_SET;
|
|
}
|
|
|
|
public Stream<Map.Entry<String, JsonNode>> propertyStream() {
|
|
return ClassUtil.emptyStream();
|
|
}
|
|
|
|
public <T extends JsonNode> T require() throws IllegalArgumentException {
|
|
return (T) _this();
|
|
}
|
|
|
|
public <T extends JsonNode> T requireNonNull() throws IllegalArgumentException {
|
|
return (T) _this();
|
|
}
|
|
|
|
public JsonNode required(String str) throws IllegalArgumentException {
|
|
return (JsonNode) _reportRequiredViolation("Node of type `%s` has no fields", getClass().getName());
|
|
}
|
|
|
|
public final JsonNode requiredAt(JsonPointer jsonPointer) throws IllegalArgumentException {
|
|
JsonNode jsonNode = this;
|
|
for (JsonPointer jsonPointer2 = jsonPointer; !jsonPointer2.matches(); jsonPointer2 = jsonPointer2.tail()) {
|
|
jsonNode = jsonNode._at(jsonPointer2);
|
|
if (jsonNode == null) {
|
|
_reportRequiredViolation("No node at '%s' (unmatched part: '%s')", jsonPointer, jsonPointer2);
|
|
}
|
|
}
|
|
return jsonNode;
|
|
}
|
|
|
|
public short shortValue() {
|
|
return (short) 0;
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public int size() {
|
|
return 0;
|
|
}
|
|
|
|
public String textValue() {
|
|
return null;
|
|
}
|
|
|
|
public String toPrettyString() {
|
|
return toString();
|
|
}
|
|
|
|
public abstract String toString();
|
|
|
|
public Stream<JsonNode> valueStream() {
|
|
return ClassUtil.emptyStream();
|
|
}
|
|
|
|
public Iterator<JsonNode> values() {
|
|
return elements();
|
|
}
|
|
|
|
@Deprecated
|
|
public <T extends JsonNode> T with(String str) {
|
|
throw new UnsupportedOperationException("`JsonNode` not of type `ObjectNode` (but " + getClass().getName() + "), cannot call `with(String)` on it");
|
|
}
|
|
|
|
public <T extends JsonNode> T withArray(String str) {
|
|
throw new UnsupportedOperationException("`JsonNode` not of type `ObjectNode` (but `" + getClass().getName() + ")`, cannot call `withArray()` on it");
|
|
}
|
|
|
|
public ArrayNode withArrayProperty(String str) {
|
|
throw new UnsupportedOperationException("`JsonNode` not of type `ObjectNode` (but `" + getClass().getName() + ")`, cannot call `withArrayProperty(String)` on it");
|
|
}
|
|
|
|
public ObjectNode withObject(String str) {
|
|
throw new UnsupportedOperationException("`withObject(String)` not implemented by `" + getClass().getName() + "`");
|
|
}
|
|
|
|
public ObjectNode withObjectProperty(String str) {
|
|
throw new UnsupportedOperationException("`JsonNode` not of type `ObjectNode` (but `" + getClass().getName() + ")`, cannot call `withObjectProperty(String)` on it");
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public JsonNode get(String str) {
|
|
return null;
|
|
}
|
|
|
|
public Optional<JsonNode> optional(String str) {
|
|
return Optional.empty();
|
|
}
|
|
|
|
public boolean asBoolean(boolean z) {
|
|
return z;
|
|
}
|
|
|
|
public int asInt(int i) {
|
|
return i;
|
|
}
|
|
|
|
public double asDouble(double d) {
|
|
return d;
|
|
}
|
|
|
|
public long asLong(long j) {
|
|
return j;
|
|
}
|
|
|
|
public boolean has(int i) {
|
|
return get(i) != null;
|
|
}
|
|
|
|
public boolean hasNonNull(int i) {
|
|
JsonNode jsonNode = get(i);
|
|
return (jsonNode == null || jsonNode.isNull()) ? false : true;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public <T extends JsonNode> T _this() {
|
|
return this;
|
|
}
|
|
|
|
public void forEachEntry(BiConsumer<? super String, ? super JsonNode> biConsumer) {
|
|
}
|
|
|
|
public JsonNode required(int i) throws IllegalArgumentException {
|
|
return (JsonNode) _reportRequiredViolation("Node of type `%s` has no indexed values", getClass().getName());
|
|
}
|
|
|
|
@Override // com.fasterxml.jackson.core.TreeNode
|
|
public final JsonNode at(String str) {
|
|
return at(JsonPointer.compile(str));
|
|
}
|
|
|
|
public JsonNode requiredAt(String str) throws IllegalArgumentException {
|
|
return requiredAt(JsonPointer.compile(str));
|
|
}
|
|
|
|
public ArrayNode withArray(String str, OverwriteMode overwriteMode, boolean z) {
|
|
return withArray(JsonPointer.compile(str), overwriteMode, z);
|
|
}
|
|
|
|
public final ObjectNode withObject(String str, OverwriteMode overwriteMode, boolean z) {
|
|
return withObject(JsonPointer.compile(str), overwriteMode, z);
|
|
}
|
|
|
|
public final ArrayNode withArray(JsonPointer jsonPointer) {
|
|
return withArray(jsonPointer, OverwriteMode.NULLS, true);
|
|
}
|
|
|
|
public final ObjectNode withObject(JsonPointer jsonPointer) {
|
|
return withObject(jsonPointer, OverwriteMode.NULLS, true);
|
|
}
|
|
|
|
public ArrayNode withArray(JsonPointer jsonPointer, OverwriteMode overwriteMode, boolean z) {
|
|
throw new UnsupportedOperationException("`withArray(JsonPointer)` not implemented by ".concat(getClass().getName()));
|
|
}
|
|
|
|
public ObjectNode withObject(JsonPointer jsonPointer, OverwriteMode overwriteMode, boolean z) {
|
|
throw new UnsupportedOperationException("`withObject(JsonPointer)` not implemented by `" + getClass().getName() + "`");
|
|
}
|
|
}
|