@Namespace(ChronoGraphConfiguration.NAMESPACE) public class ChronoGraphConfigurationImpl extends AbstractConfiguration implements ChronoGraphConfiguration { // ================================================================================================================= // FIELDS // ================================================================================================================= @Parameter(key = ChronoGraphConfiguration.TRANSACTION_CHECK_ID_EXISTENCE_ON_ADD) private boolean checkIdExistenceOnAdd = true; @Parameter(key = ChronoGraphConfiguration.TRANSACTION_AUTO_OPEN) private boolean txAutoOpenEnabled = true; // ================================================================================================================= // GETTERS // ================================================================================================================= @Override public boolean isCheckIdExistenceOnAddEnabled() { return this.checkIdExistenceOnAdd; } @Override public boolean isTransactionAutoOpenEnabled() { return this.txAutoOpenEnabled; } }
public String getKey() { String namespace = this.getNamespace(); String key = this.getParameterAnnotation().key().trim(); if (key == null || key.isEmpty()) { key = this.field.getName(); } if (namespace == null) { return key; } if (key.startsWith(namespace + '.') && key.length() > namespace.length() + 1) { return key; } return namespace + '.' + key; }
public boolean isOptional() { return this.getParameterAnnotation().optional(); }
@Namespace(ChronoSphereConfiguration.NAMESPACE) public class ChronoSphereConfigurationImpl extends AbstractConfiguration implements ChronoSphereConfiguration { // ===================================================================================================================== // FIELDS // ===================================================================================================================== @Parameter(key = BATCH_INSERT__BATCH_SIZE, optional = true) private int batchInsertBatchSize = 10_000; // ===================================================================================================================== // GETTERS & SETTERS // ===================================================================================================================== @Override public int getBatchInsertBatchSize() { return this.batchInsertBatchSize; } }
@Namespace(ChronosBuildConfiguration.NAMESPACE) public class ChronosBuildConfigurationImpl extends AbstractConfiguration implements ChronosBuildConfiguration { // ===================================================================================================================== // PROPERTIES // ===================================================================================================================== @Parameter(key = ChronosBuildConfiguration.BUILD_VERSION, optional = false) private String chronosVersion; // ===================================================================================================================== // GETTERS // ===================================================================================================================== @Override public String getBuildVersion() { return this.chronosVersion; } }
@Namespace("org.chronos.common.test") public class BooleanDependentConfiguration extends AbstractConfiguration { @Parameter private Boolean bool; @Parameter @RequiredIf(field = "bool", comparison = Comparison.IS_SET_TO, compareValue = "true") private String string; public Boolean getBool() { return this.bool; } public String getString() { return this.string; } }
@Parameter(key = DEBUG) private boolean debugModeEnabled = false; @Parameter(key = STORAGE_BACKEND) private ChronosBackend backendType; @Parameter(key = STORAGE_BACKEND_CACHE) @IgnoredIf(field = "backendType", comparison = Comparison.IS_SET_TO, compareValue = "JDBC") @IgnoredIf(field = "backendType", comparison = Comparison.IS_SET_TO, compareValue = "FILE") @Parameter(key = CACHING_ENABLED) private boolean cachingEnabled = false; @Parameter(key = CACHE_MAX_SIZE) @RequiredIf(field = "cachingEnabled", comparison = Comparison.IS_SET_TO, compareValue = "true") private Integer cacheMaxSize; @Parameter(key = QUERY_CACHE_ENABLED) private boolean indexQueryCachingEnabled = false; @Parameter(key = QUERY_CACHE_MAX_SIZE) @RequiredIf(field = "indexQueryCachingEnabled", comparison = Comparison.IS_SET_TO, compareValue = "true") private Integer indexQueryCacheMaxSize; @Parameter(key = ASSUME_CACHE_VALUES_ARE_IMMUTABLE) @RequiredIf(field = "cachingEnabled", comparison = Comparison.IS_SET_TO, compareValue = "true") private boolean assumeCachedValuesAreImmutable = false; @Parameter(key = COMMIT_CONFLICT_RESOLUTION_STRATEGY, optional = true)
@Parameter private String name; @Parameter(key = "integer", optional = false) private int intValue = 42; @ValueAlias(alias = "sat", mapTo = "SATURDAY") @ValueAlias(alias = "sun", mapTo = "SUNDAY") @Parameter(key = "org.chronos.common.test.day", optional = true) private DayOfWeek dayOfWeek; @Parameter @IgnoredIf(field = "dayOfWeek", comparison = Comparison.IS_SET_TO, compareValue = "SATURDAY") @IgnoredIf(field = "dayOfWeek", comparison = Comparison.IS_SET_TO, compareValue = "SUNDAY") private Double motivation; @Parameter() @RequiredIf(field = "dayOfWeek", comparison = Comparison.IS_SET_TO, compareValue = "MONDAY") private Boolean hangover; @Parameter(optional = true) @ValueConverter(CoordinateParser.class) private Coordinate coordinate; @Parameter(optional = true) @EnumFactoryMethod("fromString") private MyEnum myEnum;