public User (Properties prop) {
        
        Enumeration e = prop.propertyNames();

        while (e.hasMoreElements()) {
            
            String key = (String) e.nextElement();
            String method = "set"+ toProperCase(key);
            String value = prop.getProperty(key);
            
            Method methodToFind = null;
            
            try {
                methodToFind = User.class.getMethod(method, new Class[] { String.class });
                
                if(methodToFind == null) {
                   // Method not found.
                } else {
                   // Method found. You can invoke the method like
                    try {
                        methodToFind.invoke(this, value);
                    } catch (Exception ex) {
                        System.out.println(ex);
                    }
                }
            } catch (NoSuchMethodException iae) {
                System.out.println(iae);
            }
        }
    
    }