try this
User user = new User(attrs.get("mail")!=null?attrs.get("mail").toString():null);
More Related Contents:
- explicit casting from super class to subclass
- casting Object array to Integer array error
- Why does the ternary operator unexpectedly cast integers?
- Why does Java implicitly (without cast) convert a `long` to a `float`?
- java: How can I do dynamic casting of a variable from one type to another?
- How to cast a double to an int in Java by rounding it down?
- Cast Int to enum in Java
- Convert boolean to int in Java
- Authenticating against Active Directory with Java on Linux
- How are integers cast to bytes in Java?
- Postgres data type cast
- How to insert a character in a string at a certain position?
- Java Class.cast() vs. cast operator
- Can’t cast to to unspecific nested type with generics
- What is the priority of casting in java?
- Cast Object to Generic Type for returning
- How to cast List to List
- How does Java Object casting work behind the scene? [duplicate]
- What is unchecked cast and how do I check it?
- Converting double to integer in Java
- Explicit casting from super-class to sub-class
- Comparator with double type
- How to avoid large if-statements and instanceof
- Casting LinkedHashMap to Complex Object
- Java casting in interfaces
- How to connect with Java into Active Directory
- Why does the xor operator on two bytes produce an int?
- Java casting order
- How do a LDAP search/authenticate against this LDAP in Java
- Cast via reflection and use of Class.cast() [duplicate]