Example usage for org.apache.wicket.util.lang Checks notEmptyShort

List of usage examples for org.apache.wicket.util.lang Checks notEmptyShort

Introduction

In this page you can find the example usage for org.apache.wicket.util.lang Checks notEmptyShort.

Prototype

public static void notEmptyShort(final String argument, final String name) 

Source Link

Document

Checks argument is not empty (not null and has a non-whitespace character)

Usage

From source file:com.github.marting.wicket.datastore.memcached.MemcachedDataStore.java

License:Apache License

/**
 * Creates MemcachedClient with the provided hostname and port
 * in the settings//  w ww  .  ja  v a 2s .  c  o m
 *
 * @param settings  The configuration for the client
 * @return A MemcachedClient
 */
private static MemcachedClient createClient(IMemcachedSettings settings) {
    Args.notNull(settings, "settings");

    String host = settings.getHost();
    Checks.notEmptyShort(host, "host");

    int port = settings.getPort();
    Checks.withinRangeShort(1, 65535, port, "port");

    try {
        MemcachedClient memcachedClient = new MemcachedClient(new InetSocketAddress(host, port));
        return memcachedClient;
    } catch (IOException iox) {
        throw new RuntimeException(iox);
    }
}