File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed
spring-context/src/main/java/org/springframework/ui Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -161,6 +161,12 @@ public boolean containsAttribute(String attributeName) {
161
161
return containsKey (attributeName );
162
162
}
163
163
164
+ @ Override
165
+ @ Nullable
166
+ public Object getAttribute (String attributeName ) {
167
+ return get (attributeName );
168
+ }
169
+
164
170
@ Override
165
171
public Map <String , Object > asMap () {
166
172
return this ;
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -76,6 +76,15 @@ public interface Model {
76
76
*/
77
77
boolean containsAttribute (String attributeName );
78
78
79
+ /**
80
+ * Return the attribute value for the given name, if any.
81
+ * @param attributeName the name of the model attribute (never {@code null})
82
+ * @return the corresponding attribute value, or {@code null} if none
83
+ * @since 5.2
84
+ */
85
+ @ Nullable
86
+ Object getAttribute (String attributeName );
87
+
79
88
/**
80
89
* Return the current set of model attributes as a Map.
81
90
*/
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -144,4 +144,15 @@ public boolean containsAttribute(String attributeName) {
144
144
return containsKey (attributeName );
145
145
}
146
146
147
+ /**
148
+ * Return the attribute value for the given name, if any.
149
+ * @param attributeName the name of the model attribute (never {@code null})
150
+ * @return the corresponding attribute value, or {@code null} if none
151
+ * @since 5.2
152
+ */
153
+ @ Nullable
154
+ public Object getAttribute (String attributeName ) {
155
+ return get (attributeName );
156
+ }
157
+
147
158
}
You can’t perform that action at this time.
0 commit comments