-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJr.java
More file actions
33 lines (27 loc) · 877 Bytes
/
Jr.java
File metadata and controls
33 lines (27 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import redis.clients.jedis.Jedis;
import java.util.Map;
public class Jr
{
public static void main(String args[])
{
Jedis redis = new Jedis("192.168.10.191", 6379);
// redis.auth(""); // password
// redis.set("java-redis", "chen jian ping");
Map<String, String> m = redis.hgetAll("National_brand");
int j = 0;
String str = "";
int v = 0;
for(Map.Entry entry : m.entrySet()) {
str = (String)entry.getKey().toString();
v = Integer.parseInt(entry.getValue().toString());
if(str.startsWith("baiyunshan")) {
if(v > 1477875600 && v < 1477962000) {
j = j + 1;
} else {
System.out.println(str + "=" + v);
}
}
}
System.out.print(j);
}
}