1010import java .lang .invoke .MethodHandles ;
1111import java .lang .invoke .MethodType ;
1212import java .lang .reflect .Method ;
13- import java .lang .reflect .Type ;
1413import java .util .ArrayList ;
1514import java .util .Arrays ;
1615import java .util .Collection ;
@@ -443,8 +442,6 @@ public MethodHandle toMethodHandle() {
443442
444443 private MessageEncoder encoder ;
445444
446- private Type returnType ;
447-
448445 private Object handle ;
449446
450447 private List <MediaType > produces = EMPTY_LIST ;
@@ -693,30 +690,6 @@ public boolean isNonBlockingSet() {
693690 return this ;
694691 }
695692
696- /**
697- * Route return type.
698- *
699- * @return Return type.
700- * @deprecated Marked for removal on 4.0
701- */
702- @ Deprecated
703- public @ Nullable Type getReturnType () {
704- return returnType ;
705- }
706-
707- /**
708- * Set route return type.
709- *
710- * @param returnType Return type.
711- * @return This route.
712- * @deprecated Marked for removal on 4.0
713- */
714- @ Deprecated
715- public @ NonNull Route setReturnType (@ Nullable Type returnType ) {
716- this .returnType = returnType ;
717- return this ;
718- }
719-
720693 /**
721694 * Response types (format) produces by this route. If set, we expect to find a match in the <code>
722695 * Accept</code> header. If none matches, we send a {@link StatusCode#NOT_ACCEPTABLE} response.
@@ -806,7 +779,8 @@ public boolean isNonBlockingSet() {
806779 * @param <T> Generic type.
807780 * @return value of the specific attribute.
808781 */
809- public @ Nullable <T > T attribute (@ NonNull String name ) {
782+ public @ Nullable <T > T getAttribute (@ NonNull String name ) {
783+ //noinspection unchecked
810784 return (T ) attributes .get (name );
811785 }
812786
@@ -828,7 +802,7 @@ public boolean isNonBlockingSet() {
828802 * @param value attribute value
829803 * @return This route.
830804 */
831- public @ NonNull Route attribute (@ NonNull String name , @ NonNull Object value ) {
805+ public @ NonNull Route setAttribute (@ NonNull String name , @ NonNull Object value ) {
832806 if (this .attributes == EMPTY_MAP ) {
833807 this .attributes = new TreeMap <>(String .CASE_INSENSITIVE_ORDER );
834808 }
@@ -1072,7 +1046,7 @@ public boolean isHttpHead() {
10721046 * @return whether this route should be considered as transactional
10731047 */
10741048 public boolean isTransactional (boolean defaultValue ) {
1075- Object attribute = attribute (Transactional .ATTRIBUTE );
1049+ Object attribute = getAttribute (Transactional .ATTRIBUTE );
10761050
10771051 if (attribute == null ) {
10781052 return defaultValue ;
0 commit comments