io.atomix.catalyst.util.Assert.notNull()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中io.atomix.catalyst.util.Assert.notNull()方法的一些代码示例,展示了Assert.notNull()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.notNull()方法的具体详情如下:
包路径:io.atomix.catalyst.util.Assert
类名称:Assert
方法名:notNull

Assert.notNull介绍

暂无

代码示例

代码示例来源:origin: atomix/copycat

FileSnapshot(SnapshotFile file, SnapshotStore store) {
 super(store);
 this.file = Assert.notNull(file, "file");
 this.store = Assert.notNull(store, "store");
}

代码示例来源:origin: atomix/copycat

SnapshotReader(Buffer buffer, Snapshot snapshot, Serializer serializer) {
 this.buffer = Assert.notNull(buffer, "buffer");
 this.snapshot = Assert.notNull(snapshot, "snapshot");
 this.serializer = Assert.notNull(serializer, "serializer");
}

代码示例来源:origin: atomix/copycat

public ClientConnection(String id, Client client, AddressSelector selector) {
 this.id = Assert.notNull(id, "id");
 this.client = Assert.notNull(client, "client");
 this.selector = Assert.notNull(selector, "selector");
}

代码示例来源:origin: atomix/copycat

/**
 * Sets the request member.
 *
 * @param member The request member.
 * @return The request builder.
 * @throws NullPointerException if {@code member} is null
 */
@SuppressWarnings("unchecked")
public T withMember(Member member) {
 request.member = Assert.notNull(member, "member");
 return (T) this;
}

代码示例来源:origin: atomix/copycat

/**
 * Sets the server selection strategy.
 *
 * @param serverSelectionStrategy The server selection strategy.
 * @return The client builder.
 */
public Builder withServerSelectionStrategy(ServerSelectionStrategy serverSelectionStrategy) {
 this.serverSelectionStrategy = Assert.notNull(serverSelectionStrategy, "serverSelectionStrategy");
 return this;
}

代码示例来源:origin: atomix/copycat

public ClientSessionSubmitter(Connection connection, ClientSessionState state, ClientSequencer sequencer, ThreadContext context) {
 this.connection = Assert.notNull(connection, "connection");
 this.state = Assert.notNull(state, "state");
 this.sequencer = Assert.notNull(sequencer, "sequencer");
 this.context = Assert.notNull(context, "context");
}

代码示例来源:origin: atomix/copycat

/**
 * Sets the entry client ID.
 *
 * @param client The entry client ID.
 * @return The register entry.
 * @throws NullPointerException if {@code client} is null
 */
public RegisterEntry setClient(String client) {
 this.client = Assert.notNull(client, "client");
 return this;
}

代码示例来源:origin: atomix/copycat

/**
 * Sets the heartbeat interval.
 *
 * @param heartbeatInterval The Raft heartbeat interval.
 * @return The Raft context.
 */
public ServerContext setHeartbeatInterval(Duration heartbeatInterval) {
 this.heartbeatInterval = Assert.notNull(heartbeatInterval, "heartbeatInterval");
 return this;
}

代码示例来源:origin: atomix/copycat

/**
 * Sets the server name.
 * <p>
 * The server name is used to
 *
 * @param name The server name.
 * @return The server builder.
 */
public Builder withName(String name) {
 this.name = Assert.notNull(name, "name");
 return this;
}

代码示例来源:origin: atomix/copycat

/**
 * Sets the client ID.
 *
 * @param client The client ID.
 * @return The request builder.
 * @throws NullPointerException if {@code client} is null
 */
public Builder withClient(String client) {
 request.client = Assert.notNull(client, "client");
 return this;
}

代码示例来源:origin: atomix/copycat

ClientSessionManager(ClientConnection connection, ClientSessionState state, ThreadContext context, ConnectionStrategy connectionStrategy, Duration sessionTimeout) {
 this.connection = Assert.notNull(connection, "connection");
 this.state = Assert.notNull(state, "state");
 this.context = Assert.notNull(context, "context");
 this.strategy = Assert.notNull(connectionStrategy, "connectionStrategy");
 this.sessionTimeout = Assert.notNull(sessionTimeout, "sessionTimeout");
}

代码示例来源:origin: atomix/copycat

/**
 * Sets the command.
 *
 * @param command The command.
 * @return The command entry.
 * @throws NullPointerException if {@code command} is null
 */
public CommandEntry setCommand(Command command) {
 this.command = Assert.notNull(command, "command");
 return this;
}

代码示例来源:origin: atomix/copycat

ServerSessionContext(long id, String client, Log log, ServerStateMachineContext context, long timeout) {
 this.id = id;
 this.client = Assert.notNull(client, "client");
 this.log = Assert.notNull(log, "log");
 this.eventIndex = id;
 this.completeIndex = id;
 this.lastApplied = id - 1;
 this.context = context;
 this.timeout = timeout;
}

代码示例来源:origin: atomix/copycat

MinorCompactionTask(SegmentManager manager, Segment segment, long snapshotIndex, long compactIndex, Compaction.Mode defaultCompactionMode) {
 this.manager = Assert.notNull(manager, "manager");
 this.segment = Assert.notNull(segment, "segment");
 this.snapshotIndex = snapshotIndex;
 this.compactIndex = compactIndex;
 this.defaultCompactionMode = Assert.notNull(defaultCompactionMode, "defaultCompactionMode");
}

代码示例来源:origin: atomix/copycat

@Override
@SuppressWarnings("unchecked")
public T withStatus(Status status) {
 response.status = Assert.notNull(status, "status");
 return (T) this;
}

代码示例来源:origin: atomix/copycat

MemorySnapshot(HeapBuffer buffer, SnapshotDescriptor descriptor, SnapshotStore store) {
 super(store);
 buffer.mark();
 this.buffer = Assert.notNull(buffer, "buffer");
 this.buffer.position(SnapshotDescriptor.BYTES).mark();
 this.descriptor = Assert.notNull(descriptor, "descriptor");
 this.store = Assert.notNull(store, "store");
}

代码示例来源:origin: atomix/copycat

/**
 * Sets the client session timeout.
 *
 * @param sessionTimeout The client's session timeout.
 * @return The client builder.
 * @throws NullPointerException if the session timeout is null
 * @throws IllegalArgumentException if the session timeout is not {@code -1} or positive
 */
public Builder withSessionTimeout(Duration sessionTimeout) {
 this.sessionTimeout = Assert.arg(Assert.notNull(sessionTimeout, "sessionTimeout"), sessionTimeout.toMillis() >= -1, "session timeout must be positive or -1");
 return this;
}

代码示例来源:origin: atomix/copycat

private ClientSession(ClientConnection connection, ClientSessionState state, ThreadContext context, ConnectionStrategy connectionStrategy, Duration sessionTimeout) {
 this.connection = Assert.notNull(connection, "connection");
 this.state = Assert.notNull(state, "state");
 this.manager = new ClientSessionManager(connection, state, context, connectionStrategy, sessionTimeout);
 ClientSequencer sequencer = new ClientSequencer(state);
 this.listener = new ClientSessionListener(connection, state, sequencer, context);
 this.submitter = new ClientSessionSubmitter(connection, state, sequencer, context);
}

代码示例来源: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 NullPointerException if {@code buffer} is null
 */
public SnapshotDescriptor(Buffer buffer) {
 this.buffer = Assert.notNull(buffer, "buffer");
 this.index = buffer.readLong();
 this.timestamp = buffer.readLong();
 this.locked = buffer.readBoolean();
 buffer.skip(BYTES - buffer.position());
}

相关文章