Java AbstractMap Usage parseSocketAddress(String address)

Here you can find the source of parseSocketAddress(String address)

Description

parse Socket Address

License

Open Source License

Declaration

public static Map.Entry<String, Integer> parseSocketAddress(String address) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.AbstractMap;
import java.util.Map;

public class Main {
    public static Map.Entry<String, Integer> parseSocketAddress(String address) {
        String hostName = null;//w  w  w . j av  a 2 s .  c o m
        Integer port = null;

        if (null != address) {
            if (-1 != address.indexOf(':')) {
                String[] split = address.split(":");
                hostName = split[0];
                port = Integer.valueOf(split[1]);
            } else {
                hostName = address;
            }
        }

        return new AbstractMap.SimpleEntry<String, Integer>(hostName, port);
    }
}

Related

  1. decodeIconUrl(String path)
  2. getClassType(Object obj)
  3. getSymmetricPropertyValueDifference( Properties propertyFileOne, Properties propertyFileTwo)
  4. parseEntityURI(final String uri)
  5. parseExportedVariable(String exportedVariable)
  6. parseVariableName(String variableName)
  7. splitByQualifier(String str)
  8. splitIntSuffix(String string)
  9. splitQueryParam( String param)