vendredi 31 juillet 2020

Get the list of invoking method name's from Hashmap put()

Can you help me to get the list method name's from the HashMap put method.

 Book book= new Book();
        book.setTitle("The Little Prince");
        book.setAuthor("Antoine de Saint-Exupery");
        book.setPrize(9.99);
        book.setPublisher("Delux Pop-up book");
        
        
        HashMap<String,String> map= new HashMap<String,String>();
        map.put("title",book.getTitle());
        map.put("author",book.getAuthor());
        map.put("prize",String.valueOf(book.getPrize()));
        map.put("publisher",validatePuplisher(book.getPublisher()));
        

Excepted result is : book.getTitle(),book.getAuthor(),String.valueOf(book.getPrize()),validatePuplisher(book.getPublisher()) ie just method name's not value from the method.





Aucun commentaire:

Enregistrer un commentaire