当前位置: 首页>>代码示例>>Java>>正文


Java Args.notNegative方法代码示例

本文整理汇总了Java中org.apache.http.util.Args.notNegative方法的典型用法代码示例。如果您正苦于以下问题:Java Args.notNegative方法的具体用法?Java Args.notNegative怎么用?Java Args.notNegative使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.http.util.Args的用法示例。


在下文中一共展示了Args.notNegative方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AbstractConnPool

import org.apache.http.util.Args; //导入方法依赖的package包/类
public AbstractConnPool(
        final ConnFactory<T, C> connFactory,
        final int defaultMaxPerRoute,
        final int maxTotal) {
    super();
    this.connFactory = Args.notNull(connFactory, "Connection factory");
    this.defaultMaxPerRoute = Args.notNegative(defaultMaxPerRoute, "Max per route value");
    this.maxTotal = Args.notNegative(maxTotal, "Max total value");
    this.lock = new ReentrantLock();
    this.routeToPool = new HashMap<T, RouteSpecificPool<T, C, E>>();
    this.leased = new HashSet<E>();
    this.available = new LinkedList<E>();
    this.pending = new LinkedList<PoolEntryFuture<E>>();
    this.maxPerRoute = new HashMap<T, Integer>();
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:16,代码来源:AbstractConnPool.java

示例2: setMaxTotal

import org.apache.http.util.Args; //导入方法依赖的package包/类
public void setMaxTotal(final int max) {
    Args.notNegative(max, "Max value");
    this.lock.lock();
    try {
        this.maxTotal = max;
    } finally {
        this.lock.unlock();
    }
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:10,代码来源:AbstractConnPool.java

示例3: setDefaultMaxPerRoute

import org.apache.http.util.Args; //导入方法依赖的package包/类
public void setDefaultMaxPerRoute(final int max) {
    Args.notNegative(max, "Max per route value");
    this.lock.lock();
    try {
        this.defaultMaxPerRoute = max;
    } finally {
        this.lock.unlock();
    }
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:10,代码来源:AbstractConnPool.java

示例4: setMaxPerRoute

import org.apache.http.util.Args; //导入方法依赖的package包/类
public void setMaxPerRoute(final T route, final int max) {
    Args.notNull(route, "Route");
    Args.notNegative(max, "Max per route value");
    this.lock.lock();
    try {
        this.maxPerRoute.put(route, Integer.valueOf(max));
    } finally {
        this.lock.unlock();
    }
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:11,代码来源:AbstractConnPool.java

示例5: ExponentialBackOffSchedulingStrategy

import org.apache.http.util.Args; //导入方法依赖的package包/类
ExponentialBackOffSchedulingStrategy(
        final ScheduledExecutorService executor,
        final long backOffRate,
        final long initialExpiryInMillis,
        final long maxExpiryInMillis) {
    this.executor = Args.notNull(executor, "Executor");
    this.backOffRate = Args.notNegative(backOffRate, "BackOffRate");
    this.initialExpiryInMillis = Args.notNegative(initialExpiryInMillis, "InitialExpiryInMillis");
    this.maxExpiryInMillis = Args.notNegative(maxExpiryInMillis, "MaxExpiryInMillis");
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:11,代码来源:ExponentialBackOffSchedulingStrategy.java

示例6: CookieOrigin

import org.apache.http.util.Args; //导入方法依赖的package包/类
public CookieOrigin(final String host, final int port, final String path, final boolean secure) {
    super();
    Args.notBlank(host, "Host");
    Args.notNegative(port, "Port");
    Args.notNull(path, "Path");
    this.host = host.toLowerCase(Locale.ROOT);
    this.port = port;
    if (!TextUtils.isBlank(path)) {
        this.path = path;
    } else {
        this.path = "/";
    }
    this.secure = secure;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:15,代码来源:CookieOrigin.java

示例7: getHopTarget

import org.apache.http.util.Args; //导入方法依赖的package包/类
@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;
    }
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:12,代码来源:HttpRoute.java

示例8: getHopTarget

import org.apache.http.util.Args; //导入方法依赖的package包/类
@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");
    HttpHost result = null;
    if (hop < hopcount-1) {
        result = this.proxyChain[hop];
    } else {
        result = this.targetHost;
    }

    return result;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:15,代码来源:RouteTracker.java

示例9: lineLen

import org.apache.http.util.Args; //导入方法依赖的package包/类
public static MessageConstraints lineLen(final int max) {
    return new MessageConstraints(Args.notNegative(max, "Max line length"), -1);
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:4,代码来源:MessageConstraints.java

示例10: ContentLengthInputStreamHC4

import org.apache.http.util.Args; //导入方法依赖的package包/类
/**
 * Wraps a session input buffer and cuts off output after a defined number
 * of bytes.
 *
 * @param in The session input buffer
 * @param contentLength The maximum number of bytes that can be read from
 * the stream. Subsequent read operations will return -1.
 */
public ContentLengthInputStreamHC4(final SessionInputBuffer in, final long contentLength) {
    super();
    this.in = Args.notNull(in, "Session input buffer");
    this.contentLength = Args.notNegative(contentLength, "Content length");
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:14,代码来源:ContentLengthInputStreamHC4.java

示例11: ContentLengthOutputStreamHC4

import org.apache.http.util.Args; //导入方法依赖的package包/类
/**
 * Wraps a session output buffer and cuts off output after a defined number
 * of bytes.
 *
 * @param out The session output buffer
 * @param contentLength The maximum number of bytes that can be written to
 * the stream. Subsequent write operations will be ignored.
 *
 * @since 4.0
 */
public ContentLengthOutputStreamHC4(final SessionOutputBuffer out, final long contentLength) {
    super();
    this.out = Args.notNull(out, "Session output buffer");
    this.contentLength = Args.notNegative(contentLength, "Content length");
}
 
开发者ID:xxonehjh,项目名称:remote-files-sync,代码行数:16,代码来源:ContentLengthOutputStreamHC4.java


注:本文中的org.apache.http.util.Args.notNegative方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。