You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/03/28 07:25:16 UTC

[GitHub] [dubbo] tiger822 edited a comment on issue #9847: org.apache.dubbo.metadata.definition.builder.MapTypeBuilder#build写死actualTypeArgsLength==2??

tiger822 edited a comment on issue #9847:
URL: https://github.com/apache/dubbo/issues/9847#issuecomment-1080291052


   单目或3目的就有问题,如下
   `
   @Data
   @NoArgsConstructor
   @AllArgsConstructor
   public class ResponseEntity<T> extends LinkedHashMap<String,Object> implements Serializable {
     private long id;
     private int errCode;
     private String message;
     private T result;
     public static <V> ResponseEntity<V> fromResult(long id, V val){
       ResponseEntity<V> ret = new ResponseEntity<>();
       ret.result = val;
       ret.id=id;
       return ret;
     }
     public static ResponseEntity fromErr(long id, int errCode, String message){
       ResponseEntity ret=new ResponseEntity(id,errCode,message,null);
       return ret;
     }
     @JsonIgnore
     public Map toMap(){
         Map map= JsonUtils.fromJson(JsonUtils.toJsonString(this), HashMap.class);
         return map;
     }
   }
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org