Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.fasterxml.jackson.databind.JsonNode;
- import com.fasterxml.jackson.databind.ObjectMapper;
- import java.io.IOException;
- public class Main {
- private static final String INPUT_ALPHA = """
- {
- "alpha": "beta",
- "gamma": false,
- "delta": {
- "intermediate": ["separator", "separator"],
- "nested": {
- "key-one": false,
- "key-two": "с моей ветки, гандон"
- }
- }
- }
- """;
- private static final String INPUT_BETA = """
- {
- "gamma": false,
- "delta": {
- "nested": {
- "key-two": "с моей ветки, гандон",
- "key-one": false
- },
- "intermediate": ["separator", "separator"]
- },
- "alpha": "beta"
- }
- """;
- public static void main(String[] args) throws IOException {
- ObjectMapper mapper = new ObjectMapper();
- JsonNode first = mapper.readTree(INPUT_ALPHA);
- JsonNode second = mapper.readTree(INPUT_BETA);
- System.out.println("Result: " + (first.equals(second)));
- }
- }
Add Comment
Please, Sign In to add comment