public < T > T getAttribute ( String name , Class < T > type , T defaultValue ) { Params . notNullOrEmpty ( name , "Attribute name" ) ; Params . notNull ( type , "Attribute type" ) ; String value = attributes . get ( name ) ; return value != null ? converter . asObject ( value , type ) : defaultValue ; }
Get attribute value converted to requested type or default value if there is no attribute with requested name . If given default value is null and attribute is not found this method still returns null that is the requested default value .