📄 decoratableobject.java
字号:
package org.python.pydev.core.structure;
import java.util.HashMap;
import java.util.Map;
/**
* This is a class that can be 'decoratable' with additional information
*/
public class DecoratableObject {
/**
* This is used so that specific refactoring engines can add information regarding its specifics in
* the request.
*/
private Map<String, Object> additionalRefactoringInfo;
/**
* Only initialize on request
*/
private Map<String, Object> getAdditionalRefactoringInfo() {
if(additionalRefactoringInfo == null){
additionalRefactoringInfo = new HashMap<String, Object>();
}
return additionalRefactoringInfo;
}
/**
* @param key this is the key for which we have some additional value relative to the
* refactoring request using it
* @param defaultValue this is the default value that should be returned if there
* is currently no value for the given key
* @return the additional info (if available) or the default specified
*/
public Object getAdditionalInfo(String key, Object defaultValue){
Object val = this.getAdditionalRefactoringInfo().get(key);
if(val == null){
return defaultValue;
}
return val;
}
/**
* Set some value for some additional info for this request.
*/
public void setAdditionalInfo(String key, Object value){
this.getAdditionalRefactoringInfo().put(key, value);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -