Skip to content

Commit

Permalink
Made getters final; added deepCopy() to PathValueOperation.getValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinF17 authored and Capstan committed Aug 6, 2020
1 parent a7c285a commit f8a4409
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Expand Up @@ -72,7 +72,7 @@ public final void serializeWithType(final JsonGenerator jgen,
serialize(jgen, provider);
}

public JsonPointer getFrom() {
public final JsonPointer getFrom() {
return from;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/fge/jsonpatch/JsonPatch.java
Expand Up @@ -151,7 +151,7 @@ public JsonNode apply(final JsonNode node)
return ret;
}

public List<JsonPatchOperation> getOperations() {
public final List<JsonPatchOperation> getOperations() {
return operations;
}

Expand Down
Expand Up @@ -94,11 +94,11 @@ protected JsonPatchOperation(final String op, final JsonPointer path)
public abstract JsonNode apply(final JsonNode node)
throws JsonPatchException;

public String getOp() {
public final String getOp() {
return op;
}

public JsonPointer getPath() {
public final JsonPointer getPath() {
return path;
}

Expand Down
Expand Up @@ -73,8 +73,8 @@ public final void serializeWithType(final JsonGenerator jgen,
serialize(jgen, provider);
}

public JsonNode getValue() {
return value;
public final JsonNode getValue() {
return value.deepCopy();
}

@Override
Expand Down

0 comments on commit f8a4409

Please sign in to comment.