made deepCopy protected to eliminate it from the public API for now.
It will be in the subsequent release.
This commit is contained in:
parent
8df7209074
commit
a973837dd4
|
@ -40,7 +40,8 @@ public final class JsonArray extends JsonElement implements Iterable<JsonElement
|
|||
elements = new ArrayList<JsonElement>();
|
||||
}
|
||||
|
||||
@Override public JsonArray deepCopy() {
|
||||
@Override
|
||||
protected JsonArray deepCopy() {
|
||||
JsonArray result = new JsonArray();
|
||||
for (JsonElement element : elements) {
|
||||
result.add(element.deepCopy());
|
||||
|
|
|
@ -35,7 +35,7 @@ public abstract class JsonElement {
|
|||
* Returns a deep copy of this element. Immutable elements like primitives
|
||||
* and nulls are not copied.
|
||||
*/
|
||||
public abstract JsonElement deepCopy();
|
||||
protected abstract JsonElement deepCopy();
|
||||
|
||||
/**
|
||||
* provides check for verifying if this element is an array or not.
|
||||
|
|
|
@ -40,7 +40,8 @@ public final class JsonNull extends JsonElement {
|
|||
// Do nothing
|
||||
}
|
||||
|
||||
@Override public JsonNull deepCopy() {
|
||||
@Override
|
||||
protected JsonNull deepCopy() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,8 @@ public final class JsonObject extends JsonElement {
|
|||
public JsonObject() {
|
||||
}
|
||||
|
||||
@Override public JsonObject deepCopy() {
|
||||
@Override
|
||||
protected JsonObject deepCopy() {
|
||||
JsonObject result = new JsonObject();
|
||||
for (Map.Entry<String, JsonElement> entry : members.entrySet()) {
|
||||
result.add(entry.getKey(), entry.getValue().deepCopy());
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
|
||||
package com.google.gson;
|
||||
|
||||
import com.google.gson.internal.$Gson$Preconditions;
|
||||
import com.google.gson.internal.LazilyParsedNumber;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
|
||||
import com.google.gson.internal.$Gson$Preconditions;
|
||||
import com.google.gson.internal.LazilyParsedNumber;
|
||||
|
||||
/**
|
||||
* A class representing a Json primitive value. A primitive value
|
||||
* is either a String, a Java primitive, or a Java primitive
|
||||
|
@ -85,7 +85,8 @@ public final class JsonPrimitive extends JsonElement {
|
|||
setValue(primitive);
|
||||
}
|
||||
|
||||
@Override public JsonPrimitive deepCopy() {
|
||||
@Override
|
||||
protected JsonPrimitive deepCopy() {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user