test.java 1.52 KB
package com.huaheng.test;

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.*;

public class test {
    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);

        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());

    }
}