com.mikerusoft.jsonable.utils.Configuration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsonable Show documentation
Show all versions of jsonable Show documentation
Small library to convert Java POJO to and from JSON
package com.mikerusoft.jsonable.utils;
import java.util.Map;
import java.util.Properties;
/**
* This is old class to store Configuration. Use {@link ConfInfo} instead
* Class is store only because of backward compatibility, actually it's fill
* new {@link ConfInfo}
*
* @author Grinfeld Mikhail
* @since 12/4/2014.
*/
@Deprecated
public class Configuration implements ContextData {
public static final String EXCLUDE_CLASS_PROPERTY = "exclude_class";
public static final String INCLUDE_PRIMITIVE_CLASS_PROPERTY = "include_primitive_class";
public static final String CLASS_PROPERTY = "class_property";
public static final String DEFAULT_CLASS_PROPERTY_VALUE = "class";
public static final String INCLUDE_NULL_PROPERTY = "include_null";
public static final String ENUM_AS_CLASS_PROPERTY = "enum_class";
/**
* Enum for moving to new type of storing configuration, without hurting existed users
*/
private enum Names{
exclude_class {
@Override
public String getValue() {
return String.valueOf(ConfInfo.isExcludeClass());
}
@Override
public void setValue(String value) {
ConfInfo.setExcludeClass(Boolean.valueOf(value));
}
},
class_property {
@Override
public String getValue() {
return ConfInfo.getClassProperty();
}
@Override
public void setValue(String value) {
ConfInfo.setClassProperty(value);
}
},
include_null {
@Override
public String getValue() {
return String.valueOf(ConfInfo.isIncludeNull());
}
@Override
public void setValue(String value) {
ConfInfo.setIncludeNull(Boolean.valueOf(value));
}
},
enum_class {
@Override
public String getValue() {
return String.valueOf(ConfInfo.isEnumAsClass());
}
@Override
public void setValue(String value) {
ConfInfo.setEnumAsClass(Boolean.valueOf(value));
}
},
include_primitive_class {
@Override
public String getValue() {
return String.valueOf(ConfInfo.isIncludePrimitiveClass());
}
@Override
public void setValue(String value) {
ConfInfo.setIncludePrimitiveClass(Boolean.valueOf(value));
}
};
public abstract String getValue();
public abstract void setValue(String value);
}
@Deprecated
/**
* Class deprecated. Use {@link ConfInfo}
*/
public Configuration() {
}
@Deprecated
/**
* Class deprecated. Use {@link ConfInfo}
*/
public Configuration(Properties defaults) {
if (defaults != null) {
for (Map.Entry
© 2015 - 2025 Weber Informatics LLC | Privacy Policy