“Cast” a String Attribute to String Java [duplicate]

try this

User user = new User(attrs.get("mail")!=null?attrs.get("mail").toString():null);

Leave a Comment