Skip to content

Commit

Permalink
Fix JavaDoc issues to be compatible with Java 8 #39
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Mar 4, 2015
1 parent f7c418b commit 51c9aa0
Show file tree
Hide file tree
Showing 66 changed files with 1,041 additions and 738 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/lambdaworks/codec/CRC16.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private CRC16() {
/**
* Create a CRC16 checksum from the bytes.
*
* @param bytes
* @param bytes input bytes
* @return CRC16 as interger value
*/
public static int crc16(byte[] bytes) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/lambdaworks/codec/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Base16 and CRC16 codecs.
*/
package com.lambdaworks.codec;
14 changes: 7 additions & 7 deletions src/main/java/com/lambdaworks/redis/AbstractRedisClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ protected <K, V, T extends RedisAsyncConnectionImpl<K, V>> T connectAsyncImpl(fi
/**
* Populate connection builder with necessary resources.
*
* @param handler
* @param connection
* @param socketAddressSupplier
* @param withReconnect
* @param connectionBuilder
* @param handler instance of a CommandHandler for writing redis commands
* @param connection implementation of a RedisConnection
* @param socketAddressSupplier address supplier for initial connect and re-connect
* @param withReconnect {@literal true} if the connection should auto-reconnect
* @param connectionBuilder connection builder to configure the connection
* @param redisURI URI of the redis instance
*/
protected void connectionBuilder(CommandHandler<?, ?> handler, RedisChannelHandler<?, ?> connection,
Supplier<SocketAddress> socketAddressSupplier, boolean withReconnect, ConnectionBuilder connectionBuilder,
Expand Down Expand Up @@ -234,8 +235,7 @@ public void addListener(RedisConnectionStateListener listener) {
/**
* Removes a listener.
*
* @param listener must not be {@literal null
* @param listener must not be {@literal null}
*/
public void removeListener(RedisConnectionStateListener listener) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public interface BaseRedisAsyncConnection<K, V> extends Closeable {
/**
* Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.
*
* @param channels
* @param channels channel keys
* @return array-reply a list of channels and number of subscribers for every channel.
*/
RedisFuture<Map<K, Long>> pubsubNumsub(K... channels);
Expand Down Expand Up @@ -89,15 +89,15 @@ public interface BaseRedisAsyncConnection<K, V> extends Closeable {
/**
* Create a SHA1 digest from a Lua script.
*
* @param script
* @param script script content
* @return the SHA1 value
*/
String digest(V script);

/**
* Discard all commands issued after MULTI.
*
* @return RedisFuture&lt;String&gt; simple-string-reply always <code>OK</code>.
* @return RedisFuture&lt;String&gt; simple-string-reply always {@code OK}.
*/
RedisFuture<String> discard();

Expand All @@ -107,37 +107,37 @@ public interface BaseRedisAsyncConnection<K, V> extends Closeable {
* @return RedisFuture&lt;List&lt;Object&gt;&gt; array-reply each element being the reply to each of the commands in the
* atomic transaction.
*
* When using <code>WATCH</code>, <code>EXEC</code> can return a
* When using {@code WATCH}, {@code EXEC} can return a
*/
RedisFuture<List<Object>> exec();

/**
* Mark the start of a transaction block.
*
* @return RedisFuture&lt;String&gt; simple-string-reply always <code>OK</code>.
* @return RedisFuture&lt;String&gt; simple-string-reply always {@code OK}.
*/
RedisFuture<String> multi();

/**
* Watch the given keys to determine execution of the MULTI/EXEC block.
*
* @param keys the key
* @return RedisFuture&lt;String&gt; simple-string-reply always <code>OK</code>.
* @return RedisFuture&lt;String&gt; simple-string-reply always {@code OK}.
*/
RedisFuture<String> watch(K... keys);

/**
* Forget about all watched keys.
*
* @return RedisFuture&lt;String&gt; simple-string-reply always <code>OK</code>.
* @return RedisFuture&lt;String&gt; simple-string-reply always {@code OK}.
*/
RedisFuture<String> unwatch();

/**
* Wait for replication.
*
* @param replicas
* @param timeout
* @param replicas minimum number of replicas
* @param timeout timeout in milliseconds
* @return number of replicas
*/
RedisFuture<Long> waitForReplication(int replicas, long timeout);
Expand Down
30 changes: 20 additions & 10 deletions src/main/java/com/lambdaworks/redis/BaseRedisConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public interface BaseRedisConnection<K, V> extends Closeable {
/**
* Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.
*
* @param channels
* @param channels channel keys
* @return array-reply a list of channels and number of subscribers for every channel.
*/
Map<K, Long> pubsubNumsub(K... channels);
Expand All @@ -65,7 +65,7 @@ public interface BaseRedisConnection<K, V> extends Closeable {
/**
* Return the role of the instance in the context of replication.
*
* @return List&lt;Object&gt array-reply where the first element is one of master, slave, sentinel and the additional
* @return List&lt;Object&gt; array-reply where the first element is one of master, slave, sentinel and the additional
* elements are role-specific.
*/
List<Object> role();
Expand All @@ -77,8 +77,18 @@ public interface BaseRedisConnection<K, V> extends Closeable {
*/
String ping();

/**
* Switch connection to Read-Only mode when connecting to a cluster.
*
* @return String simple-string-reply.
*/
String readOnly();

/**
* Switch connection to Read-Write mode (default) when connecting to a cluster.
*
* @return String simple-string-reply.
*/
String readWrite();

/**
Expand All @@ -91,15 +101,15 @@ public interface BaseRedisConnection<K, V> extends Closeable {
/**
* Create a SHA1 digest from a Lua script.
*
* @param script
* @param script script content
* @return the SHA1 value
*/
String digest(V script);

/**
* Discard all commands issued after MULTI.
*
* @return String simple-string-reply always <code>OK</code>.
* @return String simple-string-reply always {@code OK}.
*/
String discard();

Expand All @@ -108,37 +118,37 @@ public interface BaseRedisConnection<K, V> extends Closeable {
*
* @return List&lt;Object&gt; array-reply each element being the reply to each of the commands in the atomic transaction.
*
* When using <code>WATCH</code>, <code>EXEC</code> can return a
* When using {@code WATCH}, {@code EXEC} can return a
*/
List<Object> exec();

/**
* Mark the start of a transaction block.
*
* @return String simple-string-reply always <code>OK</code>.
* @return String simple-string-reply always {@code OK}.
*/
String multi();

/**
* Watch the given keys to determine execution of the MULTI/EXEC block.
*
* @param keys the key
* @return String simple-string-reply always <code>OK</code>.
* @return String simple-string-reply always {@code OK}.
*/
String watch(K... keys);

/**
* Forget about all watched keys.
*
* @return String simple-string-reply always <code>OK</code>.
* @return String simple-string-reply always {@code OK}.
*/
String unwatch();

/**
* Wait for replication.
*
* @param replicas
* @param timeout
* @param replicas minimum number of replicas
* @param timeout timeout in milliseconds
* @return number of replicas
*/
Long waitForReplication(int replicas, long timeout);
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/lambdaworks/redis/KeyValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
* @author Will Glozer
*/
public class KeyValue<K, V> {

public final K key;
public final V value;

/**
*
* @param key
* @param value
* @param key the key
* @param value the value
*/
public KeyValue(K key, V value) {
this.key = key;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/lambdaworks/redis/KillArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
*
* Argument list builder for the redis <a href="http://redis.io/commands/client-kill">CLIENT KILL</a> command. Static import the
* methods from {@link Builder} and chain the method calls: <code>id(1).skipme()</code>.
* methods from {@link Builder} and chain the method calls: {@code id(1).skipme()}.
*
* @author <a href="mailto:mpaluch@paluch.biz">Mark Paluch</a>
* @since 3.0
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/lambdaworks/redis/LettuceFutures.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public static boolean awaitAll(long timeout, TimeUnit unit, Future<?>... futures
* @param cmd Command to wait for.
* @param timeout Maximum time to wait for futures to complete.
* @param unit Unit of time for the timeout.
* @param unit Unit of time for the timeout.
* @param <K> Key type.
* @param <V> Value type.
* @param <T> Result type.
*
* @return True if all futures complete in time.
*/
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/com/lambdaworks/redis/LettuceStrings.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.lambdaworks.redis;

/**
* @author <a href="mailto:mpaluch@paluch.biz">Mark Paluch</a>>
* @author <a href="mailto:mpaluch@paluch.biz">Mark Paluch</a>
* @since 3.0
*/
public class LettuceStrings {
Expand All @@ -14,9 +14,7 @@ private LettuceStrings() {
}

/**
* <p>
* Checks if a CharSequence is empty ("") or null.
* </p>
*
* @param cs the char sequence
* @return true if empty
Expand All @@ -26,9 +24,7 @@ public static boolean isEmpty(final CharSequence cs) {
}

/**
* <p>
* Checks if a CharSequence is not empty ("") and not null.
* </p>
*
* @param cs the char sequence
* @return true if not empty
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/com/lambdaworks/redis/RedisAsyncConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,30 @@
public interface RedisAsyncConnection<K, V> extends RedisHashesAsyncConnection<K, V>, RedisKeysAsyncConnection<K, V>,
RedisStringsAsyncConnection<K, V>, RedisListsAsyncConnection<K, V>, RedisSetsAsyncConnection<K, V>,
RedisSortedSetsAsyncConnection<K, V>, RedisScriptingAsyncConnection<K, V>, RedisServerAsyncConnection<K, V>,
RedisHLLAsyncConnection<K, V>, BaseRedisAsyncConnection<K, V> , RedisClusterAsyncConnection<K, V>{
RedisHLLAsyncConnection<K, V>, BaseRedisAsyncConnection<K, V>, RedisClusterAsyncConnection<K, V> {

/**
* Set the default timeout for operations.
*
* @param timeout
* @param unit
* @param timeout the timeout value
* @param unit the unit of the timeout value
*/
void setTimeout(long timeout, TimeUnit unit);

/**
* Change the selected database for the current connection.
* Authenticate to the server.
*
* @param db
* @param password the password
* @return String simple-string-reply
*/
String select(int db);
String auth(String password);

/**
* Authenticate to the server.
* Change the selected database for the current connection.
*
* @param password
* @param db the database number
* @return String simple-string-reply
*/
String auth(String password);
String select(int db);

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class RedisAsyncConnectionImpl<K, V> extends RedisChannelHandler<K, V> im
/**
* Initialize a new connection.
*
* @param writer
* @param writer the channel writer
* @param codec Codec used to encode/decode keys and values.
* @param timeout Maximum time to wait for a response.
* @param unit Unit of time for the timeout.
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/lambdaworks/redis/RedisChannelHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public abstract class RedisChannelHandler<K, V> extends ChannelInboundHandlerAda
private boolean active = true;

/**
* @param writer
* @param timeout
* @param unit
* @param writer the channel writer
* @param timeout timeout value
* @param unit unit of the timeout
*/
public RedisChannelHandler(RedisChannelWriter<K, V> writer, long timeout, TimeUnit unit) {
this.channelWriter = writer;
Expand Down Expand Up @@ -89,7 +89,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
/**
* Invoked on a channel read.
*
* @param msg
* @param msg channel message
*/
public void channelRead(Object msg) {

Expand All @@ -102,8 +102,8 @@ protected <T> RedisCommand<K, V, T> dispatch(RedisCommand<K, V, T> cmd) {
/**
* Register Closeable resources. Internal access only.
*
* @param registry
* @param closeables
* @param registry registry of closeables
* @param closeables closeables to register
*/
public void registerCloseables(final Collection<Closeable> registry, final Closeable... closeables) {
registry.addAll(Arrays.asList(closeables));
Expand Down Expand Up @@ -162,7 +162,7 @@ public void deactivated() {

/**
*
* @return RedisChannelWriter<K, V>
* @return the channel writer
*/
public RedisChannelWriter<K, V> getChannelWriter() {
return channelWriter;
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/com/lambdaworks/redis/RedisChannelWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
public interface RedisChannelWriter<K, V> extends Closeable {

/**
* Write a command on the channel.
* Write a command on the channel. The command may be changed/wrapped during write and the written instance is returned
* after the call.
*
* @param command
* @return RedisCommand<K, V, T>
* @param command the redis command
* @param <T> result type
* @return the written redis command
*/
<T> RedisCommand<K, V, T> write(RedisCommand<K, V, T> command);

Expand All @@ -34,7 +36,7 @@ public interface RedisChannelWriter<K, V> extends Closeable {
/**
* Set the corresponding connection instance in order to notify it about channel active/inactive state.
*
* @param redisChannelHandler
* @param redisChannelHandler the channel handler (external connection object)
*/
void setRedisChannelHandler(RedisChannelHandler<K, V> redisChannelHandler);
}

0 comments on commit 51c9aa0

Please sign in to comment.