Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2013 eBuddy B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ebuddy.cassandra.structure;
import static java.util.AbstractMap.SimpleEntry;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ebuddy.cassandra.Path;
/**
* Support for composing paths back to complex objects.
* Only the basic JSON structures are supported, i.e. Maps, Lists, Strings, Numbers, Booleans, and null.
*
* It is possible to write data that will cause inconsistencies in an object structure
* when it is reconstructed. This implementation will resolve inconsistencies as follows:
*
* If data objects are found at a particular path as well as longer paths, the data object
* is returned in a map structure with the special key "@ROOT". This may cause an error
* if the data is later attempted to be deserialized into a POJO.
*
* If list elements are found at the same level as longer paths or a data object, then
* the list elements are returned in a map with the index as keys in the map, e.g. "@0", "@1",
* etc.
*
* If inconsistencies such as these are preventing data from being deserialized into a
* particular POJO, the data can always be retrieved using an instance of (a subclass of) TypeReference