You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: org.springframework.beans/src/main/java/org/springframework/beans/factory/config/DestructionAwareAttributeMap.java
+37-23Lines changed: 37 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -57,27 +57,33 @@ public Map<String, Object> getAttributeMap() {
57
57
/**
58
58
* Returns the attribute having the specified name, if available,
59
59
* <code>null</code> otherwise.
60
-
* @param name the name of the attribute to be returned
60
+
*
61
+
* @param name
62
+
* the name of the attribute to be returned
61
63
* @return the attribute value or <code>null</code> if not available
62
64
*/
63
-
publicObjectget(Stringname) {
65
+
@SuppressWarnings("unchecked")
66
+
public <T> TgetAttribute(Stringname) {
64
67
synchronized (attributes) {
65
-
returnattributes.get(name);
68
+
return(T) attributes.get(name);
66
69
}
67
70
}
68
71
69
72
/**
70
73
* Puts the given object with the specified name as an attribute to the
71
74
* underlying map.
72
75
*
73
-
* @param name the name of the attribute
74
-
* @param value the value to be stored
76
+
* @param name
77
+
* the name of the attribute
78
+
* @param value
79
+
* the value to be stored
75
80
* @return any previously object stored under the same name, if any,
0 commit comments