Test treemap

package com.suning.fms.ttms.service.impl;

import com.alibaba.fastjson.JSON;

import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

/**
* Created by atai555 on 2020/2/21.
*/
public class AAA {

public static void main(String[] args) {
System.out.println("hello");
Map<String, String> map = new HashMap<String, String>();
map.put("1", "a01");
map.put("5", "a05");
map.put("2", "a02");
map.put("12", "a02");
map.put("6", "a02");
Map<String, String> treeMap = new TreeMap<String, String>();
treeMap.putAll(map);
System.out.println (TreeMap);

String S = "{\" 01 \ ": \" data reconciliation internet \ ", \" 02 \ ": \" compensation data reconciliation internet \ ", \" 09 \ " : \ "extended warranty premiums \", \ "10 \": \ "domestic ticket collection and payment \", \ "11 \": \ "domestic ticket vendor fee \", \ "12 \": \ " Promotions bear party settlement \ ", \" 13 \ ": \" small loan \ ", \" 14 \ ": \" network of scan code to pay \ ", \" 15 \ ": \" points against the color \ " \ "18 \": \ "copper liquidation \", \ "19 \": \ "hotel collection and payment \", \ "20 \": \ "hotel commission \", \ "22 \": \ " small loans outside the reminder commission \ ", \" 23 \ ": \" card management system \ ", \" 24 \ ": \" fund distribution \ ", \" 25 \ ": \" promotion to knot settlement \ " \ "26 \": \ "promotion after the end settlement \", \ "27 \": \ "I would rather mutual-management fee \", \ "28 \": \ "Nine wealthy insurance premiums \", \ "29 \ ": \" collection fee \ ", \" 31 \ ": \"Equity-settled \ ", \" 32 \ ": \" financial burden data \ ", \" 33 \ ": \" credit card installment discount \ ", \" 34 \ ": \" willful credit data platform - gold shop experience platform discount \ ", \" 35 \ ": \" retail cloud - cargo charge loans - interest \ ", \" 37 \ ": \" refused credit drainage settlement \ ", \" 39 \ ": \" car stipend and loan service fee \ ", \" 40 \ ": \" loan sub-Run \ ", \" 41 \ ": \" account as fast melt system \ ", \" 42 \ ": \" insurance financial system \ ", \ "44 \": \ "balloon loan \", \ "45 \": \ "willful credit limit \", \ "47 \": \ "easy to pay Bao Loaning \", \ "48 \": \ " capricious consumer pay Loaning \ ", \" 57 \ ": \" discount fee settlement \ ", \" 58 \ ": \" the cost of capital settlement \ ", \" 59 \ ": \" monthly interest settlement \ " \ "60 \": \ "profit-clearing \", \ "64 \": \ "wayward single credit \"} ";
Map JSON.parseObject = (S, TreeMap.class);34 \ ": \" willful credit data platform - platform gold shop experience discount \ ", \" 35 \ ": \" Retail cloud - cargo charge loans - interest \ ", \" 37 \ ": \" refused credit drainage settlement \ ", \" 39 \ ": \" car stipend and loan service fees \ ", \" 40 \ ": \" loan sub-Run \ ", \" 41 \ ": \" account as fast melt system \ " \ "42 \": \ "insurance financial system \", \ "44 \": \ "balloon loan \", \ "45 \": \ "amount of wayward mortgage \", \ "47 \": \ "easy Fu Bao Loaning \ ", \" 48 \ ": \" willful pay consumption Loaning \ ", \" 57 \ ": \" discount fee settlement \ ", \" 58 \ ": \" the cost of capital settlement \ " , \ "59 \": \ "settled monthly interest \", \ "60 \": \ "profit-clearing \", \ "64 \": \ "wayward single credit \"} "; Map the JSON =. parseObject (s, TreeMap.class);34 \ ": \" willful credit data platform - platform gold shop experience discount \ ", \" 35 \ ": \" Retail cloud - cargo charge loans - interest \ ", \" 37 \ ": \" refused credit drainage settlement \ ", \" 39 \ ": \" car stipend and loan service fees \ ", \" 40 \ ": \" loan sub-Run \ ", \" 41 \ ": \" account as fast melt system \ " \ "42 \": \ "insurance financial system \", \ "44 \": \ "balloon loan \", \ "45 \": \ "amount of wayward mortgage \", \ "47 \": \ "easy Fu Bao Loaning \ ", \" 48 \ ": \" willful pay consumption Loaning \ ", \" 57 \ ": \" discount fee settlement \ ", \" 58 \ ": \" the cost of capital settlement \ " , \ "59 \": \ "settled monthly interest \", \ "60 \": \ "profit-clearing \", \ "64 \": \ "wayward single credit \"} "; Map the JSON =. parseObject (s, TreeMap.class);\ "Loan sub-run \", \ "41 \": \ "account fast melt systems \", \ "42 \": \ "insurance financial system \", \ "44 \": \ "balloon loan \" , \ "45 \": \ "willful credit limit \", \ "47 \": \ "easy to pay Bao Loaning \", \ "48 \": \ "willful pay consumption Loaning \", \ "57 \ ": \" discount fee settlement \ ", \" 58 \ ": \" the cost of capital settlement \ ", \" 59 \ ": \" monthly interest settlement \ ", \" 60 \ ": \" profit-sharing settlement \ ", \" 64 \ ": \" wayward single credit \ "}"; Map JSON.parseObject = (S, TreeMap.class);\ "Loan sub-run \", \ "41 \": \ "account fast melt systems \", \ "42 \": \ "insurance financial system \", \ "44 \": \ "balloon loan \" , \ "45 \": \ "willful credit limit \", \ "47 \": \ "easy to pay Bao Loaning \", \ "48 \": \ "willful pay consumption Loaning \", \ "57 \ ": \" discount fee settlement \ ", \" 58 \ ": \" the cost of capital settlement \ ", \" 59 \ ": \" monthly interest settlement \ ", \" 60 \ ": \" profit-sharing settlement \ ", \" 64 \ ": \" wayward single credit \ "}"; Map JSON.parseObject = (S, TreeMap.class);60 \ ": \" profit-clearing \ ", \" 64 \ ": \" wayward single credit \ "}"; Map JSON.parseObject = (S, TreeMap.class);60 \ ": \" profit-clearing \ ", \" 64 \ ": \" wayward single credit \ "}"; Map JSON.parseObject = (S, TreeMap.class);
System.out.println (Map);
treeMap.putAll (Map);
S = "{\" 05 \ ": \" Data handling makeup \ ", \" 06 \ ": \" premium \ ", \" 07 \ ": \" commission \ ", \" 08 \ ": \" extended warranty service fee \ ", \" 65 \ ": \" single wayward loans 555 \ "}";
treeMap.putAll (JSON.parseObject ( S, TreeMap.class));
System.out.println (TreeMap);
treeMap.remove ( "10");
System.out.println (TreeMap);

String s2 = "{\" 01 \ ": \" reconciliation platform data \ ", \" 02 \ ": \" reconciliation platform compensation data \ ", \" 09 \ ": \" extended warranty premiums \ " \ "10 \": \ "domestic ticket collection and payment \", \ "11 \": \ "domestic ticket vendor fee \", \ "12 \": \ "undertake promotional party settlement \", \ " 13 \ ": \" small loan \ ", \" 14 \ ": \" network of scan code to pay \ ", \" 15 \ ": \" points against the color \ ", \" 18 \ ": \" copper liquidation \ ", \" 19 \ ": \" hotel collection and payment \ ", \" 20 \ ": \" hotel commission \ ", \" 22 \ ": \" small loans outside the reminder commission \ "\ "23 \": \ "card management system \", \ "24 \": \ "fund distribution \", \ "25 \": \ "promotion to knot settlement \", \ "26 \": \ "promotion after the knot settlement \ ", \" 27 \ ": \" I would rather mutual-management fee \ ", \" 28 \ ": \" Nine wealthy insurance premiums \ ", \" 29 \ ": \" collection fee \ " , \ "31 \": \ "equity-settled \", \ "32 \": \ "financial burden data \"\ "33 \": \ "credit card installment discount \", \ "34 \": \ "willful credit data platform - platform gold shop experience discount \", \ "35 \": \ "Retail cloud - stock lending charge - interest \ ", \" 37 \ ": \" refused credit drainage settlement \ ", \" 39 \ ": \" car stipend and loan service fees \ ", \" 40 \ ": \" loan sub-Run \ " , \ "41 \": \ "account fast melt systems \", \ "42 \": \ "insurance financial system \", \ "44 \": \ "balloon loan \", \ "45 \": \ "quota wayward loans \", \ "47 \": \ "easy to pay Bao Loaning \", \ "48 \": \ "willful pay consumption Loaning \", \ "57 \": \ "discount fee settlement \ ", \" 58 \ ": \" the cost of capital settlement \ ", \" 59 \ ": \" monthly interest settlement \ ", \" 60 \ ": \" profit-sharing settlement \ ", \" 64 \ " : \ "wayward single credit \"} ";
Map = JSON.parseObject (S2, TreeMap.class);
System.out.println (Map);35 \ ": \" Retail cloud - cargo charge loans - interest \ ", \" 37 \ ": \" refused credit drainage settlement \ ", \" 39 \ ": \" car stipend and loan service fees \ ", \" 40 \ ": \" loan sub-run \ ", \" 41 \ ": \" account fast melt systems \ ", \" 42 \ ": \" insurance financial system \ ", \" 44 \ ": \" balloon loan \ ", \" 45 \ ": \" willful credit limit \ ", \" 47 \ ": \" easy to pay Bao Loaning \ ", \" 48 \ ": \" willful pay consumption Loaning \ " , \ "57 \": \ "discount fee settlement \", \ "58 \": \ "the cost of capital settlement \", \ "59 \": \ "monthly interest settlement \", \ "60 \": \ "profit-clearing \", \ "64 \": \ "wayward single credit \"} "; Map = JSON.parseObject (S2, TreeMap.class); System.out.println (Map);35 \ ": \" Retail cloud - cargo charge loans - interest \ ", \" 37 \ ": \" refused credit drainage settlement \ ", \" 39 \ ": \" car stipend and loan service fees \ ", \" 40 \ ": \" loan sub-run \ ", \" 41 \ ": \" account fast melt systems \ ", \" 42 \ ": \" insurance financial system \ ", \" 44 \ ": \" balloon loan \ ", \" 45 \ ": \" willful credit limit \ ", \" 47 \ ": \" easy to pay Bao Loaning \ ", \" 48 \ ": \" willful pay consumption Loaning \ " , \ "57 \": \ "discount fee settlement \", \ "58 \": \ "the cost of capital settlement \", \ "59 \": \ "monthly interest settlement \", \ "60 \": \ "profit-clearing \", \ "64 \": \ "wayward single credit \"} "; Map = JSON.parseObject (S2, TreeMap.class); System.out.println (Map);\ "42 \": \ "insurance financial system \", \ "44 \": \ "balloon loan \", \ "45 \": \ "amount of wayward mortgage \", \ "47 \": \ "easy Fu Bao Loaning \ ", \" 48 \ ": \" willful pay consumption Loaning \ ", \" 57 \ ": \" discount fee settlement \ ", \" 58 \ ": \" the cost of capital settlement \ " , \ "59 \": \ "settled monthly interest \", \ "60 \": \ "profit-clearing \", \ "64 \": \ "wayward single credit \"} "; Map the JSON =. the parseObject (S2, TreeMap.class); System.out.println (Map);\ "42 \": \ "insurance financial system \", \ "44 \": \ "balloon loan \", \ "45 \": \ "amount of wayward mortgage \", \ "47 \": \ "easy Fu Bao Loaning \ ", \" 48 \ ": \" willful pay consumption Loaning \ ", \" 57 \ ": \" discount fee settlement \ ", \" 58 \ ": \" the cost of capital settlement \ " , \ "59 \": \ "settled monthly interest \", \ "60 \": \ "profit-clearing \", \ "64 \": \ "wayward single credit \"} "; Map the JSON =. the parseObject (S2, TreeMap.class); System.out.println (Map);}"; map = JSON.parseObject(s2, TreeMap.class); System.out.println(map);}"; map = JSON.parseObject(s2, TreeMap.class); System.out.println(map);
s2 = "{\" 05 \ ": \" making it up fee data \ ", \" 06 \ ": \" premium \ ", \" 07 \ ": \" commission \ ", \" 08 \ ": \ "extended warranty service fee \", \ "65 \": \ "single wayward loans 555 \"} ";
the Map <String, String> MAP2 = JSON.parseObject (s2, TreeMap.class);
System.out.println (MAP2);
map.putAll (MAP2);
map.remove ( "10");
System.out.println (Map);

S2 = "{. 5: \" data handling makeup \ ", 6: \" premium \ "55: \" commission \ "}";
the Map <String, String> = new new treeMap2 the TreeMap <String, String> ();
treeMap2 = JSON.parseObject (S2, TreeMap.class);
System.out.println (treeMap2 );

}
}

Guess you like

Origin www.cnblogs.com/atai/p/12345345.html