@Test public void testConfiguration() { Configuration c = new Configuration(); c.set("foo", "bar"); Assert.assertEquals(c.get("foo", null), "bar"); Assert.assertEquals(c.get("bar", "foo"), "foo"); }
public Configuration() { readOnly = false; putWithSystemPropertyDefault(MMAP_SEGMENT_SIZE, "1073741824"); putWithSystemPropertyDefault(MMAP_DATA_ENABLED, "true"); putWithSystemPropertyDefault(LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(CACHE_ENABLED, "false"); putWithSystemPropertyDefault(CACHE_INITIAL_CAPACITY, "1000"); putWithSystemPropertyDefault(CACHE_LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(COMPRESSION_ENABLED, "false"); long cacheMemory = Math.max(0, Runtime.getRuntime().maxMemory() - (100 * 1024 * 1024)); putWithSystemPropertyDefault(CACHE_BYTES, String.valueOf(cacheMemory)); serializers = new Serializers(); }
Configuration implements Serializable { public Configuration() { readOnly = false; putWithSystemPropertyDefault(MMAP_SEGMENT_SIZE, "1073741824"); putWithSystemPropertyDefault(MMAP_DATA_ENABLED, "true"); putWithSystemPropertyDefault(LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(CACHE_ENABLED, "false"); putWithSystemPropertyDefault(CACHE_INITIAL_CAPACITY, "1000"); putWithSystemPropertyDefault(CACHE_LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(COMPRESSION_ENABLED, "false"); long cacheMemory = Math.max(0, Runtime.getRuntime().maxMemory() - (100 * 1024 * 1024)); putWithSystemPropertyDefault(CACHE_BYTES, String.valueOf(cacheMemory)); serializers = new Serializers(); } }
Configuration implements Serializable { public Configuration() { readOnly = false; putWithSystemPropertyDefault(MMAP_SEGMENT_SIZE, "1073741824"); putWithSystemPropertyDefault(MMAP_DATA_ENABLED, "true"); putWithSystemPropertyDefault(LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(CACHE_ENABLED, "false"); putWithSystemPropertyDefault(CACHE_INITIAL_CAPACITY, "1000"); putWithSystemPropertyDefault(CACHE_LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(COMPRESSION_ENABLED, "false"); long cacheMemory = Math.max(0, Runtime.getRuntime().maxMemory() - (100 * 1024 * 1024)); putWithSystemPropertyDefault(CACHE_BYTES, String.valueOf(cacheMemory)); serializers = new Serializers(); } Configuration();   Configuration(Configuration configuration); }
Configuration implements Serializable { public Configuration() { readOnly = false; putWithSystemPropertyDefault(MMAP_SEGMENT_SIZE, "1073741824"); putWithSystemPropertyDefault(MMAP_DATA_ENABLED, "true"); putWithSystemPropertyDefault(LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(CACHE_ENABLED, "false"); putWithSystemPropertyDefault(CACHE_INITIAL_CAPACITY, "1000"); putWithSystemPropertyDefault(CACHE_LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(COMPRESSION_ENABLED, "false"); long cacheMemory = Math.max(0, Runtime.getRuntime().maxMemory() - (100 * 1024 * 1024)); putWithSystemPropertyDefault(CACHE_BYTES, String.valueOf(cacheMemory)); serializers = new Serializers(); } Configuration();   Configuration(Configuration configuration); String get(String key, String defaultString); Configuration set(String key, String value); boolean getBoolean(String key, boolean defaultValue); boolean getBoolean(String key); short getShort(String key, short defaultValue); short getShort(String key); long getLong(String key, long defaultValue); long getLong(String key); int getInt(String key, int defaultValue); int getInt(String key); double getDouble(String key, double defaultValue); double getDouble(String key); float getFloat(String key, float defaultValue); float getFloat(String key); List<String> getList(String key, List<String> defaultValue); List<String> getList(String key); @SuppressWarnings("unchecked") Class<T> getClass(String key); void registerSerializer(Serializer serializer); Serializer getSerializer(Class cls); Serializers getSerializers(); @Override boolean equals(Object o); @Override int hashCode(); }
Configuration implements Serializable { public Configuration() { readOnly = false; putWithSystemPropertyDefault(MMAP_SEGMENT_SIZE, "1073741824"); putWithSystemPropertyDefault(MMAP_DATA_ENABLED, "true"); putWithSystemPropertyDefault(LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(CACHE_ENABLED, "false"); putWithSystemPropertyDefault(CACHE_INITIAL_CAPACITY, "1000"); putWithSystemPropertyDefault(CACHE_LOAD_FACTOR, "0.75"); putWithSystemPropertyDefault(COMPRESSION_ENABLED, "false"); long cacheMemory = Math.max(0, Runtime.getRuntime().maxMemory() - (100 * 1024 * 1024)); putWithSystemPropertyDefault(CACHE_BYTES, String.valueOf(cacheMemory)); serializers = new Serializers(); } Configuration();   Configuration(Configuration configuration); String get(String key, String defaultString); Configuration set(String key, String value); boolean getBoolean(String key, boolean defaultValue); boolean getBoolean(String key); short getShort(String key, short defaultValue); short getShort(String key); long getLong(String key, long defaultValue); long getLong(String key); int getInt(String key, int defaultValue); int getInt(String key); double getDouble(String key, double defaultValue); double getDouble(String key); float getFloat(String key, float defaultValue); float getFloat(String key); List<String> getList(String key, List<String> defaultValue); List<String> getList(String key); @SuppressWarnings("unchecked") Class<T> getClass(String key); void registerSerializer(Serializer serializer); Serializer getSerializer(Class cls); Serializers getSerializers(); @Override boolean equals(Object o); @Override int hashCode(); final static String MMAP_SEGMENT_SIZE; final static String MMAP_DATA_ENABLED; final static String LOAD_FACTOR; final static String CACHE_ENABLED; final static String CACHE_BYTES; final static String CACHE_INITIAL_CAPACITY; final static String CACHE_LOAD_FACTOR; final static String COMPRESSION_ENABLED; }