dangsn
2024-12-25 2f8555410f031e66ee91ee60f64d1cc9a34cc7d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.vci.client.omd.attribpool.toOutside;
 
import java.util.ArrayList;
 
/**
 * 提供一些常用的功能
 * @author Administrator
 *
 */
public class Tool {
    public static final String ALLOWNULL = "allowNull";
    public static final String BTM = "btm";
    public static final String ISFIXLEN = "isFixLen";
    public static final String LENGTH = "length";
    public static final String ENUMNAME = "enumName";
    public static final String ACCURACY = "accuracy";
    public static final String LINKTYPENAME = "linkTypeName";
    public static final String VERSION = "version";
    
    /**
     * Array ----> ArrayList
     * @param array
     * @return
     */
    public static ArrayList<String> convertArrayToList(String[] array){
        ArrayList<String> list = new ArrayList<String>();
        for(int i = 0; i < array.length; i++){
            list.add(array[i]);
        }
        return list;
    }
    
    /**
     * 获取other中指定项目的值
     * @return
     */
    public static String getOtherValueByType(String other, String type){
        String[] otherArray = other.split(";");
        for(int i = 0; i < otherArray.length; i++){
            String otherValue = otherArray[i];
            if(otherValue.contains(type)){
                return otherValue.substring(otherValue.indexOf("=") + 2, otherValue.length());
            }
        }
        return null;
        
    }
}