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

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

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

Assert.arg介绍

暂无

代码示例

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

/**
 * Sets the last sequence number.
 *
 * @param lastSequence The last sequence number.
 * @return The command response builder.
 */
@SuppressWarnings("unchecked")
public T withLastSequence(long lastSequence) {
 response.lastSequence = Assert.arg(lastSequence, lastSequence >= 0, "lastSequence must be positive");
 return (T) this;
}

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

/**
 * Sets the request term.
 *
 * @param term The request term.
 * @return The append request builder.
 * @throws IllegalArgumentException if the {@code term} is not positive
 */
public Builder withTerm(long term) {
 request.term = Assert.arg(term, term > 0, "term must be positive");
 return this;
}

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

/**
 * Sets the request term.
 *
 * @param term The request term.
 * @return The append request builder.
 * @throws IllegalArgumentException if the {@code term} is not positive
 */
public Builder withTerm(long term) {
 request.term = Assert.arg(term, term > 0, "term must be positive");
 return this;
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

/**
 * Sets the request term.
 *
 * @param term The request term.
 * @return The append request builder.
 * @throws IllegalArgumentException if the {@code term} is not positive
 */
public Builder withTerm(long term) {
 request.term = Assert.arg(term, term > 0, "term must be positive");
 return this;
}

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

/**
 * Sets the request term.
 *
 * @param term The request term.
 * @return The append request builder.
 * @throws IllegalArgumentException if the {@code term} is not positive
 */
public Builder withTerm(long term) {
 request.term = Assert.arg(term, term > 0, "term must be positive");
 return this;
}

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

/**
 * Sets the client session timeout.
 *
 * @param timeout The client session timeout.
 * @return The request builder.
 * @throws IllegalArgumentException if the timeout is not {@code -1} or a positive number
 */
public Builder withTimeout(long timeout) {
 request.timeout = Assert.arg(timeout, timeout >= -1, "timeout must be -1 or greater");
 return this;
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

/**
 * Sets the request term.
 *
 * @param term The request term.
 * @return The append request builder.
 * @throws IllegalArgumentException if the {@code term} is not positive
 */
public Builder withTerm(long term) {
 request.term = Assert.arg(term, term > 0, "term must be positive");
 return this;
}

代码示例来源:origin: io.atomix.copycat/copycat-server

/**
 * Sets the request term.
 *
 * @param term The request term.
 * @return The append request builder.
 * @throws IllegalArgumentException if the {@code term} is not positive
 */
public Builder withTerm(long term) {
 request.term = Assert.arg(term, term > 0, "term must be positive");
 return this;
}

代码示例来源:origin: io.atomix.catalyst/catalyst-common

/**
 * @throws IllegalArgumentException when {@code expression} is true
 */
public static void argNot(boolean expression, String errorMessageFormat, Object... args) {
 arg(!expression, errorMessageFormat, args);
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

/**
 * Sets the request term.
 *
 * @param term The request term.
 * @return The append request builder.
 * @throws IllegalArgumentException if the {@code term} is not positive
 */
public Builder withTerm(long term) {
 request.term = Assert.arg(term, term > 0, "term must be positive");
 return this;
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

/**
 * @throws IllegalArgumentException when {@code expression} is false
 */
public static <T> T arg(T argument, boolean expression, String errorMessageFormat, Object... args) {
 arg(expression, errorMessageFormat, args);
 return argument;
}

代码示例来源:origin: io.atomix.copycat/copycat-server

/**
 * Sets the request term.
 *
 * @param term The request term.
 * @return The append request builder.
 * @throws IllegalArgumentException if the {@code term} is not positive
 */
public Builder withTerm(long term) {
 request.term = Assert.arg(term, term > 0, "term must be positive");
 return this;
}

代码示例来源:origin: io.atomix.copycat/copycat-server

/**
 * Sets the request term.
 *
 * @param term The request term.
 * @return The append request builder.
 * @throws IllegalArgumentException if the {@code term} is not positive
 */
public Builder withTerm(long term) {
 request.term = Assert.arg(term, term > 0, "term must be positive");
 return this;
}

代码示例来源:origin: io.atomix/catalyst-common

public static <T> T arg(T argument, boolean expression, String errorMessageFormat, Object... args) {
 arg(expression, errorMessageFormat, args);
 return argument;
}

代码示例来源:origin: org.onosproject/onlab-thirdparty

/**
 * @throws IllegalArgumentException when {@code expression} is true
 */
public static <T> T argNot(T argument, boolean expression, String errorMessageFormat, Object... args) {
 return arg(argument, !expression, errorMessageFormat, args);
}

代码示例来源:origin: io.atomix.catalyst/catalyst-common

/**
 * @throws IllegalArgumentException when {@code expression} is false
 */
public static <T> T arg(T argument, boolean expression, String errorMessageFormat, Object... args) {
 arg(expression, errorMessageFormat, args);
 return argument;
}

代码示例来源:origin: io.atomix.catalyst/catalyst-common

/**
 * @throws IllegalArgumentException when {@code expression} is true
 */
public static <T> T argNot(T argument, boolean expression, String errorMessageFormat, Object... args) {
 return arg(argument, !expression, errorMessageFormat, args);
}

代码示例来源:origin: io.atomix.copycat/copycat-protocol

/**
 * Sets the client session timeout.
 *
 * @param timeout The client session timeout.
 * @return The request builder.
 * @throws IllegalArgumentException if the timeout is not {@code -1} or a positive number
 */
public Builder withTimeout(long timeout) {
 request.timeout = Assert.arg(timeout, timeout >= -1, "timeout must be -1 or greater");
 return this;
}

代码示例来源:origin: io.atomix.copycat/copycat-protocol

/**
 * Sets the last sequence number.
 *
 * @param lastSequence The last sequence number.
 * @return The command response builder.
 */
@SuppressWarnings("unchecked")
public T withLastSequence(long lastSequence) {
 response.lastSequence = Assert.arg(lastSequence, lastSequence >= 0, "lastSequence must be positive");
 return (T) this;
}

代码示例来源: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;
}

相关文章