本文整理了Java中io.atomix.catalyst.util.Assert.argNot()
方法的一些代码示例,展示了Assert.argNot()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.argNot()
方法的具体详情如下:
包路径:io.atomix.catalyst.util.Assert
类名称:Assert
方法名:argNot
暂无
代码示例来源:origin: atomix/copycat
/**
* Sets the response term.
*
* @param term The response term.
* @return The append response builder
* @throws IllegalArgumentException if {@code term} is not positive
*/
public Builder withTerm(long term) {
response.term = Assert.argNot(term, term <= 0, "term must be positive");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the request last log index.
*
* @param index The request last log index.
* @return The append request builder.
* @throws IllegalArgumentException if the {@code index} is not positive
*/
public Builder withLogIndex(long index) {
request.logIndex = Assert.argNot(index, index < 0, "log index must be not be negative");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the request index.
*
* @param index The request index.
* @return The request builder.
*/
public Builder withIndex(long index) {
request.index = Assert.argNot(index, index < 0, "index must be positive");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the command sequence number.
*
* @param commandSequence The command sequence number.
* @return The request builder.
* @throws IllegalArgumentException if {@code commandSequence} is less than 0
*/
public Builder withCommandSequence(long commandSequence) {
request.commandSequence = Assert.argNot(commandSequence, commandSequence < 0, "commandSequence cannot be negative");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the event index.
*
* @param index The event index.
* @return The request builder.
* @throws IllegalArgumentException if {@code index} is less than 1
*/
public Builder withEventIndex(long index) {
request.eventIndex = Assert.argNot(index, index < 1, "index cannot be less than 1");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the request term.
*
* @param term The request term.
* @return The poll request builder.
* @throws IllegalArgumentException if {@code term} is negative
*/
public Builder withTerm(long term) {
request.term = Assert.argNot(term, term < 0, "term must not be negative");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the request last log term.
*
* @param term The request last log term.
* @return The poll request builder.
* @throws IllegalArgumentException if {@code term} is negative
*/
public Builder withLogTerm(long term) {
request.logTerm = Assert.argNot(term, term < 0,"log term must not be negative");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the response index.
*
* @param index The response index.
* @return The response builder.
* @throws IllegalArgumentException If the response index is not positive.
*/
@SuppressWarnings("unchecked")
public T withIndex(long index) {
response.index = Assert.argNot(index, index < 0, "index must be positive");
return (T) this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the request index.
*
* @param index The request index.
* @return The request builder.
*/
public Builder withIndex(long index) {
request.index = Assert.argNot(index, index < 0, "index must be positive");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the response time.
*
* @param time The response time.
* @return The response builder.
* @throws IllegalArgumentException if {@code time} is negative
*/
@SuppressWarnings("unchecked")
public T withTime(long time) {
response.timestamp = Assert.argNot(time, time <= 0, "timestamp cannot be negative");
return (T) this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the response term.
*
* @param term The response term.
* @return The vote response builder.
* @throws IllegalArgumentException if {@code term} is negative
*/
public Builder withTerm(long term) {
response.term = Assert.argNot(term, term < 0, "term cannot be negative");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the request last log term.
*
* @param term The request last log term.
* @return The append request builder.
* @throws IllegalArgumentException if the {@code term} is not positive
*/
public Builder withLogTerm(long term) {
request.logTerm = Assert.argNot(term, term < 0, "term must be positive");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the request commit index.
*
* @param index The request commit index.
* @return The append request builder.
* @throws IllegalArgumentException if index is not positive
*/
public Builder withCommitIndex(long index) {
request.commitIndex = Assert.argNot(index, index < 0, "commit index must not be negative");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the request global index.
*
* @param index The request global index.
* @return The append request builder.
* @throws IllegalArgumentException if index is not positive
*/
public Builder withGlobalIndex(long index) {
request.globalIndex = Assert.argNot(index, index < 0, "global index must not be negative");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the response index.
*
* @param index The response index.
* @return The response builder.
* @throws IllegalArgumentException if {@code index} is negative
*/
@SuppressWarnings("unchecked")
public T withIndex(long index) {
response.index = Assert.argNot(index, index < 0, "index cannot be negative");
return (T) this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the session timeout.
*
* @param timeout The session timeout.
* @return The register response builder.
* @throws IllegalArgumentException if the session timeout is not positive
*/
public Builder withTimeout(long timeout) {
response.timeout = Assert.argNot(timeout, timeout <= 0, "timeout must be positive");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the member's next index.
*
* @param nextIndex The member's next index.
* @return The member state.
*/
MemberState setNextIndex(long nextIndex) {
this.nextIndex = Assert.argNot(nextIndex, nextIndex <= 0, "nextIndex cannot be less than or equal to 0");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the event index.
*
* @param eventIndex The event index.
* @return The request builder.
* @throws IllegalArgumentException if {@code eventIndex} is less than 0
*/
public Builder withEventIndex(long eventIndex) {
request.eventIndex = Assert.argNot(eventIndex, eventIndex < 0, "eventIndex cannot be negative");
return this;
}
代码示例来源:origin: atomix/copycat
/**
* Sets the previous event index.
*
* @param index The previous event index.
* @return The request builder.
* @throws IllegalArgumentException if {@code index} is less than 1
*/
public Builder withPreviousIndex(long index) {
request.previousIndex = Assert.argNot(index, index < 0, "index cannot be less than 0");
return this;
}
代码示例来源:origin: atomix/copycat
public Configuration(long index, long term, long time, Collection<Member> members) {
this.index = index;
this.term = term;
this.time = Assert.argNot(time, time <= 0, "time must be positive");
this.members = Assert.notNull(members, "members");
}
内容来源于网络,如有侵权,请联系作者删除!