Skip to content

Commit

Permalink
Use GeoArgs parameter in georadiusbymember method #142
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Sep 27, 2015
1 parent c7f36f8 commit af11700
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/com/lambdaworks/redis/RedisCommandBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,6 @@ public Command<K, V, List<GeoWithin<V>>> georadius(K key, double longitude, doub

assertNotNull(geoArgs, "geoArgs must not be null");
CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key).add(longitude).add(latitude).add(distance).add(unit);

geoArgs.build(args);

return createCommand(GEORADIUS, new GeoWithinListOutput<K, V>(codec, geoArgs.isWithDistance(), geoArgs.isWithHash(),
Expand All @@ -1804,8 +1803,9 @@ public Command<K, V, Set<V>> georadiusbymember(K key, V member, double distance,
}

public Command<K, V, List<GeoWithin<V>>> georadiusbymember(K key, V member, double distance, String unit, GeoArgs geoArgs) {
CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key).addValue(member).add(distance).add(unit);
assertNotNull(geoArgs, "geoArgs must not be null");
CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key).addValue(member).add(distance).add(unit);
geoArgs.build(args);

return createCommand(
GEORADIUSBYMEMBER,
Expand All @@ -1828,7 +1828,6 @@ public Command<K, V, Double> geodist(K key, V from, V to, GeoArgs.Unit unit) {
}

return createCommand(GEODIST, new DoubleOutput<K, V>(codec), args);

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ public void georadiusbymemberWithArgs() throws Exception {

GeoWithin<String> weinheim = georadiusbymember.get(0);
assertThat(weinheim.member).isEqualTo("Weinheim");
assertThat(weinheim.distance).isNotNull();
assertThat(weinheim.coordinates).isNotNull();
}

@Test(expected = IllegalArgumentException.class)
Expand Down

0 comments on commit af11700

Please sign in to comment.