org.apache.http.util.Asserts#notNull ( )源码实例Demo

下面列出了org.apache.http.util.Asserts#notNull ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: instamojo-java   文件: InstamojoImpl.java
@Override
public Refund createRefund(Refund refund) throws HTTPException, ConnectionException {
    Asserts.notNull(refund, "Refund");

    try {
        String response = HttpUtils.post(context.getApiPath(Constants.PATH_REFUND + refund.getPaymentId() + "" +
                "/refund/"), getHeaders(), gson.toJson(refund));

        Type type = new TypeToken<ApiResponse<Refund>>() {
        }.getType();
        ApiResponse<Refund> createRefundResponse = gson.fromJson(response, type);
        return createRefundResponse.getResult();

    } catch (IOException e) {
        throw new ConnectionException(e.getMessage(), e);
    }
}
 
源代码2 项目: vind   文件: ElasticSearchServer.java
@Override
public IndexResult index(List<Document> docs) {
    Asserts.notNull(docs,"Document to index should not be null.");
    Asserts.check(!docs.isEmpty(), "Should be at least one document to index.");

    return  indexMultipleDocuments(docs, -1);
}
 
源代码3 项目: vind   文件: ElasticSearchServer.java
@Override
public IndexResult indexWithin(List<Document> docs, int withinMs) {
    Asserts.notNull(docs,"Document to index should not be null.");
    Asserts.check(!docs.isEmpty(), "Should be at least one document to index.");
    log.warn("Parameter 'within' not in use in elastic search backend");
    return  indexMultipleDocuments(docs, withinMs);
}
 
源代码4 项目: vind   文件: SolrSearchServer.java
@Override
public IndexResult index(List<Document> docs) {
    Asserts.notNull(docs,"Document to index should not be null.");
    Asserts.check(docs.size() > 0, "Should be at least one document to index.");

    return  indexMultipleDocuments(docs, -1);
}
 
源代码5 项目: instamojo-java   文件: InstamojoImpl.java
@Override
public PaymentOrderResponse createPaymentOrder(PaymentOrder paymentOrder) throws HTTPException, ConnectionException {
    Asserts.notNull(paymentOrder, "Payment Order");

    try {
        String response = HttpUtils.post(context.getApiPath(Constants.PATH_PAYMENT_ORDER), getHeaders(),
                gson.toJson(paymentOrder));
        return gson.fromJson(response, PaymentOrderResponse.class);

    } catch (IOException e) {
        throw new ConnectionException(e.getMessage(), e);
    }
}
 
源代码6 项目: instamojo-java   文件: InstamojoImpl.java
@Override
public PaymentRequest createPaymentRequest(PaymentRequest paymentRequest) throws ConnectionException, HTTPException {
    Asserts.notNull(paymentRequest, "payment request");

    try {
        String response = HttpUtils.post(
                context.getApiPath(Constants.PATH_PAYMENT_REQUEST), getHeaders(), gson.toJson(paymentRequest));
        return gson.fromJson(response, PaymentRequest.class);

    } catch (IOException e) {
        throw new ConnectionException(e.getMessage(), e);
    }
}
 
源代码7 项目: timer   文件: EntityBuilderProvider.java
public HttpEntity builder() {
    Asserts.notNull(this.entityBuilder, "entityBuilder should not be null");
    return this.entityBuilder.build();
}
 
源代码8 项目: timer   文件: MultipartEntityBuilderProvider.java
public HttpEntity builder() {
    Asserts.notNull(multipartEntityBuilder, "entityBuilder should not be null");
    return this.multipartEntityBuilder.build();
}
 
源代码9 项目: vind   文件: ElasticSearchServer.java
@Override
public IndexResult index(Document... docs) {
    Asserts.notNull(docs,"Document to index should not be null.");
    Asserts.check(docs.length > 0, "Should be at least one document to index.");
    return indexMultipleDocuments(Arrays.asList(docs), -1);
}
 
源代码10 项目: vind   文件: ElasticSearchServer.java
@Override
public IndexResult indexWithin(Document doc, int withinMs) {
    Asserts.notNull(doc,"Document to index should not be null.");
    log.warn("Parameter 'within' not in use in elastic search backend");
    return indexMultipleDocuments(Collections.singletonList(doc), withinMs);
}
 
源代码11 项目: vind   文件: SolrSearchServer.java
@Override
public IndexResult index(Document ... docs) {
    Asserts.notNull(docs,"Document to index should not be null.");
    Asserts.check(docs.length > 0, "Should be at least one document to index.");
    return indexMultipleDocuments(Arrays.asList(docs), -1);
}
 
源代码12 项目: jkes   文件: Config.java
public static JkesProperties getJkesProperties() {
    Asserts.notNull(jkesProperties, "JkesProperties config must be set into Config");
    return jkesProperties;
}
 
 方法所在类
 同类方法