mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
enchance mapping support
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.alibaba.druid.mapping;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class MappingObject {
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
public Map<String, Object> getAttributes() {
|
||||
if (attributes == null) {
|
||||
attributes = new HashMap<String, Object>(1);
|
||||
}
|
||||
|
||||
return attributes;
|
||||
}
|
||||
|
||||
public Object getAttribute(String name) {
|
||||
if (attributes == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return attributes.get(name);
|
||||
}
|
||||
|
||||
public void putAttribute(String name, Object value) {
|
||||
if (attributes == null) {
|
||||
attributes = new HashMap<String, Object>(1);
|
||||
}
|
||||
|
||||
attributes.put(name, value);
|
||||
}
|
||||
|
||||
public Map<String, Object> getAttributesDirect() {
|
||||
return attributes;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user