forked from loafle/openapi-generator-original
Adding Config and ConfigParser classes
This commit is contained in:
38
modules/swagger-codegen/src/main/java/config/Config.java
Normal file
38
modules/swagger-codegen/src/main/java/config/Config.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package config;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Config {
|
||||
private Map<String, String> options;
|
||||
|
||||
public Config() {
|
||||
this.options = new HashMap<String, String>();
|
||||
}
|
||||
|
||||
public Config(Map<String, String> properties) {
|
||||
this.options = properties;
|
||||
}
|
||||
|
||||
public Map<String, String> getOptions() {
|
||||
return ImmutableMap.copyOf(options);
|
||||
}
|
||||
|
||||
public boolean hasOption(String opt){
|
||||
return options.containsKey(opt);
|
||||
}
|
||||
|
||||
public String getOption(String opt){
|
||||
return options.get(opt);
|
||||
}
|
||||
|
||||
public void setOption(String opt, String value){
|
||||
options.put(opt, value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user