-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java: Add LRange and LTrim commands. (List Commands) #1041
Java: Add LRange and LTrim commands. (List Commands) #1041
Conversation
* @param elements The elements to insert at the tail of the list stored at <code>key</code>. | ||
* @return Command Response - The length of the list after the push operations. | ||
*/ | ||
public T rpush(@NonNull String key, @NonNull String[] elements) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just diff issue? Or did you move these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move new functions to the end to avoid this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am roughly following the order that they had in the Node client and Py. (they differ from each other a bit). This was just a rebase mistake at some point so i just moved it to the correct spot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since git fails to detect that you added few functions in the middle, you have to reorder them. The actual order does not matter, I added all commends to the end to simplify reviewing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
java/integTest/src/test/java/glide/TransactionTestUtilities.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/ListBaseCommands.java
Outdated
Show resolved
Hide resolved
* @param elements The elements to insert at the tail of the list stored at <code>key</code>. | ||
* @return Command Response - The length of the list after the push operations. | ||
*/ | ||
public T rpush(@NonNull String key, @NonNull String[] elements) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move new functions to the end to avoid this
java/client/src/main/java/glide/api/models/BaseTransaction.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/BaseTransaction.java
Outdated
Show resolved
Hide resolved
java/client/src/test/java/glide/api/models/TransactionTests.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/ListBaseCommands.java
Outdated
Show resolved
Hide resolved
|
||
/** | ||
* Trims an existing list so that it will contain only the specified range of elements specified. | ||
* <br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
is in a new line, but in lrange it's not, let's be consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is caused by Spotless hence why it looks like that.
@@ -572,6 +523,109 @@ public T lpopCount(@NonNull String key, long count) { | |||
return getThis(); | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comments
* @param elements The elements to insert at the tail of the list stored at <code>key</code>. | ||
* @return Command Response - The length of the list after the push operations. | ||
*/ | ||
public T rpush(@NonNull String key, @NonNull String[] elements) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
e62eac7
to
88b44ee
Compare
* | ||
* @see <a href="https://redis.io/commands/rpop/">redis.io</a> for details. | ||
* @param count The count of the elements to pop from the list. | ||
* @returns Command Response - An array of popped elements will be returned depending on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @returns Command Response - An array of popped elements will be returned depending on the | |
* @return Command Response - An array of popped elements will be returned depending on the |
* @param key The key of the list. | ||
* @param start The starting point of the range. | ||
* @param end The end of the range. | ||
* @return Always <code>OK</code>. <br> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @return Always <code>OK</code>. <br> | |
* @return Always <code>OK</code>.<br> |
return getThis(); | ||
} | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reorder to simplify the diff
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.