DATAREDIS-1122 - Polishing.
Consistently use Maxlen lettercasing. Add since tags. Reformat code. Original pull request: #523.
This commit is contained in:
@@ -262,6 +262,7 @@ public interface ReactiveStreamCommands {
|
||||
* Limit the size of the stream to the given maximum number of elements.
|
||||
*
|
||||
* @return can be {@literal null}.
|
||||
* @since 2.3
|
||||
*/
|
||||
@Nullable
|
||||
public Long getMaxlen() {
|
||||
@@ -270,8 +271,9 @@ public interface ReactiveStreamCommands {
|
||||
|
||||
/**
|
||||
* @return {@literal true} if {@literal MAXLEN} is set.
|
||||
* @since 2.3
|
||||
*/
|
||||
public boolean hasMaxLen() {
|
||||
public boolean hasMaxlen() {
|
||||
return maxlen != null && maxlen > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,9 @@ public interface RedisStreamCommands {
|
||||
*/
|
||||
class XAddOptions {
|
||||
|
||||
private @Nullable Long maxlen;
|
||||
private static final XAddOptions NONE = new XAddOptions(null);
|
||||
|
||||
private final @Nullable Long maxlen;
|
||||
|
||||
private XAddOptions(@Nullable Long maxlen) {
|
||||
this.maxlen = maxlen;
|
||||
@@ -123,7 +125,7 @@ public interface RedisStreamCommands {
|
||||
* @return
|
||||
*/
|
||||
public static XAddOptions none() {
|
||||
return new XAddOptions(null);
|
||||
return NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,7 +150,7 @@ public interface RedisStreamCommands {
|
||||
/**
|
||||
* @return {@literal true} if {@literal MAXLEN} is set.
|
||||
*/
|
||||
public boolean hasMaxLen() {
|
||||
public boolean hasMaxlen() {
|
||||
return maxlen != null && maxlen > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class LettuceReactiveStreamCommands implements ReactiveStreamCommands {
|
||||
if (!command.getRecord().getId().shouldBeAutoGenerated()) {
|
||||
args.id(command.getRecord().getId().getValue());
|
||||
}
|
||||
if(command.hasMaxLen()) {
|
||||
if (command.hasMaxlen()) {
|
||||
args.maxlen(command.getMaxlen());
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class LettuceStreamCommands implements RedisStreamCommands {
|
||||
|
||||
XAddArgs args = new XAddArgs();
|
||||
args.id(record.getId().getValue());
|
||||
if(options.hasMaxLen()) {
|
||||
if (options.hasMaxlen()) {
|
||||
args.maxlen(options.getMaxlen());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user