Example usage for com.google.common.net HostSpecifier from

List of usage examples for com.google.common.net HostSpecifier from

Introduction

In this page you can find the example usage for com.google.common.net HostSpecifier from.

Prototype

public static HostSpecifier from(String specifier) throws ParseException 

Source Link

Document

Attempts to return a HostSpecifier for the given string, throwing an exception if parsing fails.

Usage

From source file:com.bennavetta.aeneas.zookeeper.impl.HostSpecifierDeserializer.java

@Override
public HostSpecifier deserialize(JsonParser jp, DeserializationContext ctxt)
        throws IOException, JsonProcessingException {
    try {//from   w ww  . j av a2 s .c o m
        return HostSpecifier.from(jp.getValueAsString());
    } catch (ParseException e) {
        throw new JsonParseException("Invalid host specifier", jp.getCurrentLocation(), e);
    }
}