wxr
2022-11-24 2af932533ef851bf983385244e9912976dbd4daa
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package com.mm.android.deviceaddmodule.mobilecommon.entity;
 
import java.io.Serializable;
import java.util.Hashtable;
import java.util.UUID;
 
 
/**
 * 文件描述:实体基类,支持克隆、序列化
 */
 
public class DataInfo implements Cloneable, Serializable  {
    
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    protected String uuid = UUID.randomUUID().toString();       // 对象唯一标示
    public Hashtable<String, Object> getExtandAttributeTable() {
        if(extandAttributeTable == null){
            extandAttributeTable = new Hashtable<>();
        }
        return extandAttributeTable;
    }
    protected Hashtable<String, Object> extandAttributeTable = null; // 扩展属性列表
    
 
    // 获得扩展属性值
    public Object getExtandAttributeValue(String name)
    {
        if (extandAttributeTable == null
            || !extandAttributeTable.containsKey(name))
        {
            return null;
        }
        
        return extandAttributeTable.get(name);
    }
    
    // 设置扩展属性
    public void setExtandAttributeValue(String name, Object value)
    {
        if (extandAttributeTable == null)
        {
            extandAttributeTable = new Hashtable<>();
        }
        if(value != null){
            extandAttributeTable.put(name, value);
        }
    }
 
    public String getUuid() {
        return uuid;
    }
    
    @Override
    public String toString() {
        return uuid;
    }
    
    
    @Override
    protected Object clone() throws CloneNotSupportedException
    {
        DataInfo dataInfo = null;
        
        dataInfo = (DataInfo) super.clone();
        
        if (extandAttributeTable != null) {
            dataInfo.extandAttributeTable = new Hashtable<>();
            dataInfo.extandAttributeTable.putAll(extandAttributeTable);
            
        }
        
        return dataInfo;
    }
    
}