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


Java Str.isEmpty方法代码示例

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


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

示例1: extractEventListenerFromMethod

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
private void extractEventListenerFromMethod(final Object listener,
                                            final MethodAccess methodAccess,
                                            final AnnotationData listen,
                                            final ServiceQueue serviceQueue) {

    logger.info("EventManager {} ::extractEventListenerFromMethod  :: " +
                    "{} is listening with method {} using annotation data {} ",
            name, serviceQueue, methodAccess.name(), listen.getValues());

    final String channel = listen.getValues().get("value").toString();

    if (Str.isEmpty(channel)) {
        return;
    }
    final boolean consume = (boolean) listen.getValues().get("consume");


    if (serviceQueue == null) {
        extractListenerForRegularObject(listener, methodAccess, channel, consume);
    } else {
        extractListenerForService(serviceQueue, channel, consume);
    }
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:24,代码来源:BoonEventManager.java

示例2: consulResponseList

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
public static <T> ConsulResponse<List<T>> consulResponseList(final Class<T> responseType, final HttpTextResponse response) {

        List<T> responseObject = null;

        if (response.code() == 200) {

            if (!Str.isEmpty(response.body())) {
                responseObject = fromJsonArray(response.body(), responseType);
            }

        } else {
            die("Unable to read response", response.code(), response.body());
        }

        int index = Integer.valueOf(response.headers().getFirst("X-Consul-Index"));
        long lastContact = Long.valueOf(response.headers().getFirst("X-Consul-Lastcontact"));
        boolean knownLeader = Boolean.valueOf(response.headers().getFirst("X-Consul-Knownleader"));

        //noinspection UnnecessaryLocalVariable
        @SuppressWarnings("UnnecessaryLocalVariable")
        ConsulResponse<List<T>> consulResponse = new ConsulResponse<>(responseObject, lastContact, knownLeader, index);

        return consulResponse;
    }
 
开发者ID:advantageous,项目名称:qbit,代码行数:25,代码来源:RequestUtils.java

示例3: getPublicPort

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
/**
 * Get the public port for service meta generation (Swagger)
 *
 * @return public port
 */
public int getPublicPort() {
    if (publicPort == -1) {

        String sport = System.getenv("PUBLIC_WEB_PORT");

        if (!Str.isEmpty(sport)) {
            publicPort = Integer.parseInt(sport);
        }
    }

    if (publicPort == -1) {
        publicPort = getPort();
    }

    return publicPort;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:22,代码来源:ManagedServiceBuilder.java

示例4: getPort

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
/**
 * Get the actual port to bind to.
 * <p>
 * Defaults to EndpointServerBuilder.DEFAULT_PORT.
 * <p>
 * Looks for PORT under PORT_WEB, PORT0, PORT.
 *
 * @return actual http port to bind to.
 */
public int getPort() {

    if (port == EndpointServerBuilder.DEFAULT_PORT) {
        String sport = System.getenv("PORT_WEB");
        /** Looks up port for Mesoshpere and the like. */
        if (Str.isEmpty(sport)) {
            sport = System.getenv("PORT0");
        }
        if (Str.isEmpty(sport)) {
            sport = System.getenv("PORT");
        }
        if (!Str.isEmpty(sport)) {
            port = Integer.parseInt(sport);
        }
    }
    return port;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:27,代码来源:ManagedServiceBuilder.java

示例5: readServiceName

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
public static String readServiceName(Annotated annotated) {
    String name = readValue("Service", annotated);

    if (Str.isEmpty(name)) {
        name = readValue("ServiceName", annotated);
    }

    if (Str.isEmpty(name)) {
        name = readValue("Named", annotated);
    }

    if (Str.isEmpty(name)) {
        name = readValue("Name", annotated);
    }


    return name == null ? "" : name;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:19,代码来源:AnnotationUtils.java

示例6: readAddressFromAnnotation

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
private String readAddressFromAnnotation(Annotated annotated) {
    String address = getAddress("RequestMapping", annotated);

    if (Str.isEmpty(address)) {
        address = getAddress("Name", annotated);
    }

    if (Str.isEmpty(address)) {
        address = getAddress("Service", annotated);
    }


    if (Str.isEmpty(address)) {
        address = getAddress("ServiceMethod", annotated);
    }

    return address == null ? "" : address;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:19,代码来源:BoonServiceMethodCallHandler.java

示例7: readNameFromAnnotation

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
private String readNameFromAnnotation(Annotated annotated) {
    String name = getAddress("Named", annotated);

    if (Str.isEmpty(name)) {
        name = getAddress("Name", annotated);
    }

    if (Str.isEmpty(name)) {
        name = getAddress("Service", annotated);
    }

    if (Str.isEmpty(name)) {
        name = getAddress("ServiceName", annotated);
    }


    return name == null ? "" : name;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:19,代码来源:BoonServiceMethodCallHandler.java

示例8: findAlias

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
private String findAlias() {
    String alias = null;
    for (String aliasAnnotation : annotationsThatHaveAliases) {
        alias = getAlias(aliasAnnotation);
        if (! Str.isEmpty(alias)) {
            bits.set( NAMED );
            break;
        }
    }

    return Str.isEmpty( alias ) ? name : alias;
}
 
开发者ID:advantageous,项目名称:boon,代码行数:13,代码来源:BaseField.java

示例9: createMapper

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
private Mapper createMapper() {
    if (useAnnotations && !caseInsensitiveFields &&
                     !acceptSingleValueAsArray && ignoreSet == null
            && Str.isEmpty(view) && respectIgnore) {
        return new MapperSimple(fieldAccessType.create(true));
    }
    return new MapperComplex(fieldAccessType, useAnnotations,
            caseInsensitiveFields, ignoreSet, view,
            respectIgnore, acceptSingleValueAsArray);
}
 
开发者ID:advantageous,项目名称:boon,代码行数:11,代码来源:JsonParserFactory.java

示例10: getHttpRequestBuilder

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
public static HttpRequestBuilder getHttpRequestBuilder(
        final String datacenter,
        final String tag,
        final RequestOptions requestOptions,
        final String path) {

    final HttpRequestBuilder httpRequestBuilder = HttpRequestBuilder.httpRequestBuilder();

    httpRequestBuilder.setUri(cleanURI(path));

    if (!Str.isEmpty(datacenter)) {
        httpRequestBuilder.addParam("dc", datacenter);
    }

    if (!Str.isEmpty(tag)) {
        httpRequestBuilder.addParam("tag", tag);
    }

    if (requestOptions!=null) {
        if (requestOptions.isBlocking()) {
            httpRequestBuilder.addParam("wait", requestOptions.getWait());
            httpRequestBuilder.addParam("index", String.valueOf(requestOptions.getIndex()));
        }

        if (requestOptions.getConsistency() == Consistency.CONSISTENT) {
            httpRequestBuilder.addParam("consistent", "true");

        }
        if (requestOptions.getConsistency() == Consistency.STALE) {
            httpRequestBuilder.addParam("stale", "true");
        }
    }
    return httpRequestBuilder;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:35,代码来源:RequestUtils.java

示例11: check

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
/**
 * Checks in with Consul.
 *
 * @param checkId The Check ID to check in.
 * @param status  The current state of the Check.
 * @param note    Any note to associate with the Check.
 */
public void check(String checkId, Status status, String note) {

    final URI uri = createURI("/check/" + status.getUri() + "/" + checkId);

    final HTTP.Response httpResponse = Str.isEmpty(note) ? HTTP.getResponse(uri.toString()) :
            HTTP.getResponse(uri.toString() + "?note=" + note);

    if (httpResponse.code() != 200) {
        notRegistered("Unable to perform check", uri, httpResponse.code(), httpResponse.statusMessageAsString(),
                httpResponse.body());
    }

}
 
开发者ID:advantageous,项目名称:qbit,代码行数:21,代码来源:AgentEndpoint.java

示例12: findAdminPort

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
/**
 * Finds the admin port.
 * Searches  under environment variables,
 * {@code QBIT_ADMIN_PORT}, {@code ADMIN_PORT}, {@code PORT1}.
 *
 * @return admin port
 */
public String findAdminPort() {

    String qbitAdminPort = System.getenv("QBIT_ADMIN_PORT");

    if (Str.isEmpty(qbitAdminPort)) {
        qbitAdminPort = System.getenv("ADMIN_PORT");
    }

    /* Uses PORT1 for admin port for Mesosphere / Heroku like environments. */
    if (Str.isEmpty(qbitAdminPort)) {
        qbitAdminPort = System.getenv("PORT1");
    }
    return qbitAdminPort;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:22,代码来源:ManagedServiceBuilder.java

示例13: getHttpServerBuilder

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
/**
 * @return http server builder
 */
public HttpServerBuilder getHttpServerBuilder() {
    if (httpServerBuilder == null) {
        httpServerBuilder = HttpServerBuilder.httpServerBuilder();

        int port = getPort();


        if (!Str.isEmpty(port)) {
            httpServerBuilder.setPort(port);
        }
    }
    return httpServerBuilder;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:17,代码来源:ManagedServiceBuilder.java

示例14: doGet

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
private RequestMetaData doGet(final String path) {

        RequestMetaData requestMetaData = metaDataMap.get(path);

        if (requestMetaData == null) {
            Map.Entry<String, NavigableMap<Integer, RequestMetaData>> uriParamNumMapEntry = treeMap.lowerEntry(path);

            if (uriParamNumMapEntry == null) {
                return null;
            }

            final String requestURI = Str.isEmpty(rootURI) ? path : StringScanner.substringAfter(path, rootURI);

            int count = Str.split(requestURI, '/').length - 1;
            NavigableMap<Integer, RequestMetaData> uriParamMap = uriParamNumMapEntry.getValue();

            requestMetaData = uriParamMap.get(count);

            if (requestMetaData != null && path.startsWith(requestMetaData.getPath())) {
                return requestMetaData;
            } else {
                return null;
            }
        } else {
            return requestMetaData;
        }
    }
 
开发者ID:advantageous,项目名称:qbit,代码行数:28,代码来源:StandardMetaDataProvider.java

示例15: getClassEventChannelName

import io.advantageous.boon.core.Str; //导入方法依赖的package包/类
public static <T> String getClassEventChannelName(ClassMeta<T> classMeta, AnnotationData classAnnotation) {
    //They could even use enum as we are getting a string value

    String classEventBusName = classAnnotation != null
            && classAnnotation.getValues().get("value") != null ? classAnnotation.getValues().get("value").toString() : null;

    if (Str.isEmpty(classEventBusName) && classAnnotation != null) {
        classEventBusName = classMeta.longName();
    }
    return classEventBusName;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:12,代码来源:AnnotationUtils.java


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