Blame view

src/test/java/com.huaheng.test/test.java 1.52 KB
xumiao authored
1
2
package com.huaheng.test;
xumiao authored
3
4
5
6
7
8
9
10
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.pc.srm.domain.FinishedProduct;
import org.apache.commons.collections.MapUtils;

import java.util.*;
xumiao authored
11
12

public class test {
xumiao authored
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    public static void main(String[] args) throws JsonProcessingException {
        Map<String, Boolean> map = new HashMap<>();
        Boolean k1 = MapUtils.getBoolean(map, "k", false);
        System.out.println(k1);
        Boolean k2 = MapUtils.getBoolean(map, "k", false);
        System.out.println(k2);

        System.out.println("=[=======================================================]=");

        Map<String, Object> map2=new HashMap();
        map2.put("state",false);
        map2.put("msg","token失效");
        String s = new ObjectMapper().writeValueAsString(map2);
        System.out.println(s);
xumiao authored
27
28
29
30
31
32
33
34
35
36
37
38
39
40
        String name1="迈信伺服电机侧电机刹车接插件";
        String name2="迈信伺服电机侧电机接插件(不带刹车)";
        String spec1=";H15/15芯航空插头;;;;适用于M";
        String spec2=";H03/3芯航空插头;;;;适用于MA";
        String code="B2023020543";
        System.out.println(name1.length());

        System.out.println(name1.substring(0,14));
        System.out.println(name2.length());
        System.out.println(spec1.length());
        System.out.println(spec2.length());
        System.out.println(code.length());
xumiao authored
41
42
    }
}