Skip to content

Commit 42a7b2e

Browse files
committed
creates configuration enum to redis
1 parent 5d5c070 commit 42a7b2e

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright (c) 2019 Otávio Santana and others
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* and Apache License v2.0 which accompanies this distribution.
6+
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7+
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
8+
*
9+
* You may elect to redistribute this code under either of these licenses.
10+
*
11+
* Contributors:
12+
*
13+
* Otavio Santana
14+
*/
15+
package org.jnosql.diana.redis.key;
16+
17+
import java.util.function.Supplier;
18+
19+
/**
20+
* Use {@link RedisConfigurations}
21+
*/
22+
@Deprecated
23+
public enum OldRedisConfigurations implements Supplier<String> {
24+
25+
HOST("redis-master-host"),
26+
PORT("redis-master-port"),
27+
TIMEOUT("redis-timeout"),
28+
PASSWORD("redis-password"),
29+
DATABASE("redis-database"),
30+
CLIENT_NAME("redis-clientName"),
31+
MAX_TOTAL("redis-configuration-max-total"),
32+
MAX_IDLE("redis-configuration-max-idle"),
33+
MIN_IDLE("redis-configuration-min-idle"),
34+
MAX_WAIT_MILLIS("redis-configuration-max--wait-millis");
35+
36+
private final String configuration;
37+
38+
OldRedisConfigurations(String configuration) {
39+
this.configuration = configuration;
40+
}
41+
42+
@Override
43+
public String get() {
44+
return configuration;
45+
}
46+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2019 Otávio Santana and others
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* and Apache License v2.0 which accompanies this distribution.
6+
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7+
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
8+
*
9+
* You may elect to redistribute this code under either of these licenses.
10+
*
11+
* Contributors:
12+
*
13+
* Otavio Santana
14+
*/
15+
package org.jnosql.diana.redis.key;
16+
17+
import java.util.function.Supplier;
18+
19+
public enum RedisConfigurations implements Supplier<String> {
20+
21+
HOST("redis.host"),
22+
PORT("redis.port"),
23+
TIMEOUT("redis.timeout"),
24+
PASSWORD("redis.password"),
25+
DATABASE("redis.database"),
26+
CLIENT_NAME("redis.clientName"),
27+
MAX_TOTAL("redis.max.total"),
28+
MAX_IDLE("redis.max.idle"),
29+
MIN_IDLE("redis.min.idle"),
30+
MAX_WAIT_MILLIS("redis.max.wait.millis");
31+
32+
private final String configuration;
33+
34+
RedisConfigurations(String configuration) {
35+
this.configuration = configuration;
36+
}
37+
38+
@Override
39+
public String get() {
40+
return configuration;
41+
}
42+
}

0 commit comments

Comments
 (0)