本文整理了Java中io.atomix.catalyst.util.Assert.stateNot()
方法的一些代码示例,展示了Assert.stateNot()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.stateNot()
方法的具体详情如下:
包路径:io.atomix.catalyst.util.Assert
类名称:Assert
方法名:stateNot
暂无
代码示例来源:origin: atomix/copycat
/**
* Returns the entry size.
*
* @return The entry size.
* @throws IllegalStateException If the entry has not yet been persisted
*/
public int size() {
Assert.stateNot(size == -1, "cannot determine size for non-persisted entry");
return size;
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if status is null
*/
@Override
public U build() {
Assert.stateNot(response.status == null, "status cannot be null");
return response;
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if sequence is less than 1 or message is null
*/
@Override
public PublishRequest build() {
super.build();
Assert.stateNot(request.eventIndex < 0, "eventIndex cannot be less than 0");
Assert.stateNot(request.previousIndex < -1, "previousIndex cannot be less than -1");
Assert.stateNot(request.events == null, "events cannot be null");
return request;
}
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if candidate is not positive or if term, logIndex or logTerm are negative
*/
@Override
public PollRequest build() {
super.build();
Assert.stateNot(request.term < 0, "term must not be negative");
Assert.stateNot(request.logIndex < 0, "log index must not be negative");
Assert.stateNot(request.logTerm < 0, "log term must not be negative");
return request;
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if candidate is not positive or if term, logIndex or logTerm are negative
*/
@Override
public VoteRequest build() {
super.build();
Assert.stateNot(request.term < 0, "term must not be negative");
Assert.stateNot(request.logIndex < 0, "log index must not be negative");
Assert.stateNot(request.logTerm < 0, "log term must not be negative");
return request;
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if status is ok and term is not positive or log index is negative
*/
@Override
public AppendResponse build() {
super.build();
if (response.status == Response.Status.OK) {
Assert.stateNot(response.term <= 0, "term must be positive");
Assert.stateNot(response.logIndex < 0, "log index must be positive");
}
return response;
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if {@code query} is null
*/
@Override
public QueryRequest build() {
super.build();
Assert.stateNot(request.index < 0, "index cannot be less than 0");
Assert.stateNot(request.query == null, "query cannot be null");
return request;
}
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if status is OK and members is null
*/
@Override
public RegisterResponse build() {
super.build();
Assert.stateNot(response.status == Status.OK && response.members == null, "members cannot be null");
Assert.stateNot(response.status == Status.OK && response.timeout <= 0, "timeout must be positive");
return response;
}
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if sequence is less than 1
*/
@Override
public ResetRequest build() {
super.build();
Assert.stateNot(request.index < 0, "index cannot be less than 0");
return request;
}
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if status is OK and members is null
*/
@Override
public ConnectResponse build() {
super.build();
Assert.stateNot(response.status == Status.OK && response.members == null, "members cannot be null");
return response;
}
}
代码示例来源:origin: atomix/copycat
@Override
public U build() {
super.build();
Assert.stateNot(request.sequence < 0, "sequence cannot be less than 0");
return request;
}
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if session or sequence are less than 1, or command is null
*/
@Override
public CommandRequest build() {
super.build();
Assert.stateNot(request.command == null, "command cannot be null");
return request;
}
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if status is OK and members is null
*/
@Override
public KeepAliveResponse build() {
super.build();
Assert.stateNot(response.status == Status.OK && response.members == null, "members cannot be null");
return response;
}
}
代码示例来源:origin: atomix/copycat
@Override
public U build() {
super.build();
Assert.stateNot(request.session < 1, "session cannot be less than 1");
return request;
}
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if client is null
*/
@Override
public RegisterRequest build() {
super.build();
Assert.stateNot(request.client == null, "client cannot be null");
return request;
}
}
代码示例来源:origin: atomix/copycat
@Override
public ConnectRequest build() {
super.build();
Assert.stateNot(request.client == null, "client cannot be null");
return request;
}
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if member is null
*/
@Override
public InstallRequest build() {
super.build();
Assert.stateNot(request.term <= 0, "term must be positive");
Assert.argNot(request.index < 0, "index must be positive");
Assert.notNull(request.data, "data");
return request;
}
}
代码示例来源:origin: atomix/copycat
/**
* @throws IllegalStateException if member is null
*/
@Override
public ConfigureRequest build() {
super.build();
Assert.stateNot(request.term <= 0, "term must be positive");
Assert.argNot(request.index < 0, "index must be positive");
Assert.notNull(request.members, "members");
return request;
}
}
代码示例来源:origin: atomix/copycat
/**
* Opens the given snapshot writer.
*/
protected SnapshotWriter openWriter(SnapshotWriter writer, SnapshotDescriptor descriptor) {
checkWriter();
Assert.stateNot(descriptor.locked(), "cannot write to locked snapshot descriptor");
this.writer = Assert.notNull(writer, "writer");
return writer;
}
代码示例来源:origin: atomix/copycat
@Override
public Snapshot complete() {
Buffer buffer = FileBuffer.allocate(file.file(), SnapshotDescriptor.BYTES);
try (SnapshotDescriptor descriptor = new SnapshotDescriptor(buffer)) {
Assert.stateNot(descriptor.locked(), "cannot complete locked snapshot descriptor");
descriptor.lock();
}
return super.complete();
}
内容来源于网络,如有侵权,请联系作者删除!