Here you can find the source of getProperField(Class objectClass)
public static String getProperField(Class objectClass)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Field; import java.net.SocketAddress; public class Main { public static String getProperField(Class objectClass) { for (Field f : objectClass.getFields()) { if (f.getType() == SocketAddress.class) { return f.getName(); }//from w w w. j av a2 s . c om } return "N/A"; } }