File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
jooby/src/main/java/io/jooby Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,9 @@ public interface Context extends Registry {
8181 *
8282 * @param key Attribute key.
8383 * @param <T> Attribute type.
84- * @return Attribute value.
84+ * @return Attribute value or <code>null</code> .
8585 */
86- @ Nonnull <T > T attribute (@ Nonnull String key );
86+ @ Nullable <T > T attribute (@ Nonnull String key );
8787
8888 /**
8989 * Set an application attribute.
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public interface DefaultContext extends Context {
7979 * @param <T> Attribute type.
8080 * @return Attribute value.
8181 */
82- @ Override @ Nonnull default <T > T attribute (@ Nonnull String key ) {
82+ @ Override @ Nullable default <T > T attribute (@ Nonnull String key ) {
8383 T attribute = (T ) getAttributes ().get (key );
8484 if (attribute == null ) {
8585 Map <String , Object > globals = getRouter ().getAttributes ();
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public ForwardingContext(@Nonnull Context context) {
6868 return ctx .getAttributes ();
6969 }
7070
71- @ Nonnull @ Override public <T > T attribute (@ Nonnull String key ) {
71+ @ Nullable @ Override public <T > T attribute (@ Nonnull String key ) {
7272 return ctx .attribute (key );
7373 }
7474
You can’t perform that action at this time.
0 commit comments