org.apache.http.util.Args.notNegative()方法的使用及代码示例

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

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

Args.notNegative介绍

暂无

代码示例

代码示例来源:origin: ibinti/bugvm

public LengthDelimitedDecoder(
    final ReadableByteChannel channel,
    final SessionInputBuffer buffer,
    final HttpTransportMetricsImpl metrics,
    final long contentLength) {
  super(channel, buffer, metrics);
  Args.notNegative(contentLength, "Content length");
  this.contentLength = contentLength;
}

代码示例来源:origin: ibinti/bugvm

@Override
public void setStatusCode(final int code) {
  Args.notNegative(code, "Status code");
  this.statusline = null;
  this.code = code;
  this.reasonPhrase = null;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Creates an instance of {@link ByteArrayBuffer} with the given initial
 * capacity.
 *
 * @param capacity the capacity
 */
public ByteArrayBuffer(final int capacity) {
  super();
  Args.notNegative(capacity, "Buffer capacity");
  this.buffer = new byte[capacity];
}

代码示例来源:origin: ibinti/bugvm

@Override
public void setStatusLine(final ProtocolVersion ver, final int code) {
  Args.notNegative(code, "Status code");
  this.statusline = null;
  this.ver = ver;
  this.code = code;
  this.reasonPhrase = null;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Creates an instance of {@link CharArrayBuffer} with the given initial
 * capacity.
 *
 * @param capacity the capacity
 */
public CharArrayBuffer(final int capacity) {
  super();
  Args.notNegative(capacity, "Buffer capacity");
  this.buffer = new char[capacity];
}

代码示例来源:origin: ibinti/bugvm

@Override
public void setStatusLine(
    final ProtocolVersion ver, final int code, final String reason) {
  Args.notNegative(code, "Status code");
  this.statusline = null;
  this.ver = ver;
  this.code = code;
  this.reasonPhrase = reason;
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpcore

/**
 * Creates an instance of {@link CharArrayBuffer} with the given initial
 * capacity.
 *
 * @param capacity the capacity
 */
public CharArrayBuffer(final int capacity) {
  super();
  Args.notNegative(capacity, "Buffer capacity");
  this.buffer = new char[capacity];
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpcore

/**
 * Creates an instance of {@link ByteArrayBuffer} with the given initial
 * capacity.
 *
 * @param capacity the capacity
 */
public ByteArrayBuffer(final int capacity) {
  super();
  Args.notNegative(capacity, "Buffer capacity");
  this.buffer = new byte[capacity];
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Creates an instance of {@link ByteArrayBuffer} with the given initial
 * capacity.
 *
 * @param capacity the capacity
 */
public ByteArrayBuffer(final int capacity) {
  super();
  Args.notNegative(capacity, "Buffer capacity");
  this.buffer = new byte[capacity];
}

代码示例来源:origin: ibinti/bugvm

/**
 * Create a protocol version designator.
 *
 * @param protocol   the name of the protocol, for example "HTTP"
 * @param major      the major version number of the protocol
 * @param minor      the minor version number of the protocol
 */
public ProtocolVersion(final String protocol, final int major, final int minor) {
  this.protocol = Args.notNull(protocol, "Protocol name");
  this.major = Args.notNegative(major, "Protocol minor version");
  this.minor = Args.notNegative(minor, "Protocol minor version");
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Create a protocol version designator.
 *
 * @param protocol   the name of the protocol, for example "HTTP"
 * @param major      the major version number of the protocol
 * @param minor      the minor version number of the protocol
 */
public ProtocolVersion(final String protocol, final int major, final int minor) {
  this.protocol = Args.notNull(protocol, "Protocol name");
  this.major = Args.notNegative(major, "Protocol minor version");
  this.minor = Args.notNegative(minor, "Protocol minor version");
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpcore

public void setDefaultMaxPerRoute(final int max) {
  Args.notNegative(max, "Max per route value");
  this.lock.lock();
  try {
    this.defaultMaxPerRoute = max;
  } finally {
    this.lock.unlock();
  }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpcore

/**
 * Create a protocol version designator.
 *
 * @param protocol   the name of the protocol, for example "HTTP"
 * @param major      the major version number of the protocol
 * @param minor      the minor version number of the protocol
 */
public ProtocolVersion(final String protocol, final int major, final int minor) {
  this.protocol = Args.notNull(protocol, "Protocol name");
  this.major = Args.notNegative(major, "Protocol minor version");
  this.minor = Args.notNegative(minor, "Protocol minor version");
}

代码示例来源:origin: org.apache.httpcomponents/httpclient-android

public void setDefaultMaxPerRoute(final int max) {
  Args.notNegative(max, "Max per route value");
  this.lock.lock();
  try {
    this.defaultMaxPerRoute = max;
  } finally {
    this.lock.unlock();
  }
}

代码示例来源:origin: org.apache.httpcomponents/httpclient-android

public void setMaxTotal(final int max) {
  Args.notNegative(max, "Max value");
  this.lock.lock();
  try {
    this.maxTotal = max;
  } finally {
    this.lock.unlock();
  }
}

代码示例来源:origin: ibinti/bugvm

@Override
public final HttpHost getHopTarget(final int hop) {
  Args.notNegative(hop, "Hop index");
  final int hopcount = getHopCount();
  Args.check(hop < hopcount, "Hop index exceeds tracked route length");
  if (hop < hopcount - 1) {
    return this.proxyChain.get(hop);
  } else {
    return this.targetHost;
  }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public final HttpHost getHopTarget(final int hop) {
  Args.notNegative(hop, "Hop index");
  final int hopcount = getHopCount();
  Args.check(hop < hopcount, "Hop index exceeds tracked route length");
  if (hop < hopcount - 1) {
    return this.proxyChain.get(hop);
  } else {
    return this.targetHost;
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
public final HttpHost getHopTarget(final int hop) {
  Args.notNegative(hop, "Hop index");
  final int hopcount = getHopCount();
  Args.check(hop < hopcount, "Hop index exceeds tracked route length");
  if (hop < hopcount - 1) {
    return this.proxyChain.get(hop);
  } else {
    return this.targetHost;
  }
}

代码示例来源:origin: Nextdoor/bender

@Override
public final HttpHost getHopTarget(final int hop) {
  Args.notNegative(hop, "Hop index");
  final int hopcount = getHopCount();
  Args.check(hop < hopcount, "Hop index exceeds tracked route length");
  if (hop < hopcount - 1) {
    return this.proxyChain.get(hop);
  } else {
    return this.targetHost;
  }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public final HttpHost getHopTarget(final int hop) {
  Args.notNegative(hop, "Hop index");
  final int hopcount = getHopCount();
  Args.check(hop < hopcount, "Hop index exceeds tracked route length");
  HttpHost result = null;
  if (hop < hopcount-1) {
    result = this.proxyChain[hop];
  } else {
    result = this.targetHost;
  }
  return result;
}

相关文章