zoukankan      html  css  js  c++  java
  • Java-Class-C:org.springframework.http.HttpEntity.java

    ylbtech-Java-Class-C:org.springframework.http.HttpEntity.java
    1.返回顶部
    1.1、
    import org.springframework.http.HttpEntity;
    1.2、

    //封装成一个请求对象
    HttpEntity entity = new HttpEntity(requestParam, headers);

    1.3、
    2.返回顶部
     
    3.返回顶部
     
    4.返回顶部
    1、
    //
    // Source code recreated from a .class file by IntelliJ IDEA
    // (powered by Fernflower decompiler)
    //
    
    package org.springframework.http;
    
    import org.springframework.lang.Nullable;
    import org.springframework.util.MultiValueMap;
    import org.springframework.util.ObjectUtils;
    
    public class HttpEntity<T> {
        public static final HttpEntity<?> EMPTY = new HttpEntity();
        private final HttpHeaders headers;
        @Nullable
        private final T body;
    
        protected HttpEntity() {
            this((Object)null, (MultiValueMap)null);
        }
    
        public HttpEntity(T body) {
            this(body, (MultiValueMap)null);
        }
    
        public HttpEntity(MultiValueMap<String, String> headers) {
            this((Object)null, headers);
        }
    
        public HttpEntity(@Nullable T body, @Nullable MultiValueMap<String, String> headers) {
            this.body = body;
            HttpHeaders tempHeaders = new HttpHeaders();
            if (headers != null) {
                tempHeaders.putAll(headers);
            }
    
            this.headers = HttpHeaders.readOnlyHttpHeaders(tempHeaders);
        }
    
        public HttpHeaders getHeaders() {
            return this.headers;
        }
    
        @Nullable
        public T getBody() {
            return this.body;
        }
    
        public boolean hasBody() {
            return this.body != null;
        }
    
        public boolean equals(@Nullable Object other) {
            if (this == other) {
                return true;
            } else if (other != null && other.getClass() == this.getClass()) {
                HttpEntity<?> otherEntity = (HttpEntity)other;
                return ObjectUtils.nullSafeEquals(this.headers, otherEntity.headers) && ObjectUtils.nullSafeEquals(this.body, otherEntity.body);
            } else {
                return false;
            }
        }
    
        public int hashCode() {
            return ObjectUtils.nullSafeHashCode(this.headers) * 29 + ObjectUtils.nullSafeHashCode(this.body);
        }
    
        public String toString() {
            StringBuilder builder = new StringBuilder("<");
            if (this.body != null) {
                builder.append(this.body);
                builder.append(',');
            }
    
            builder.append(this.headers);
            builder.append('>');
            return builder.toString();
        }
    }
    2、
    5.返回顶部
     
     
    6.返回顶部
     
    warn 作者:ylbtech
    出处:http://ylbtech.cnblogs.com/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    django with mysql (part-4)
    django with mysql (part-3)
    django with mysql (part-2)
    [LeetCode] 22. 括号生成(回溯/DP)
    [算法]求满足要求的进制(辗转相除(欧几里得算法),求最大公约数gcd)
    [算法]体积不小于V的情况下的最小价值(0-1背包)
    [LeetCode]96. 不同的二叉搜索树(DP,卡特兰数)
    [LeetCode]98. 验证二叉搜索树
    [LeetCode]21. 合并两个有序链表(递归)
    [LeetCode]538. 把二叉搜索树转换为累加树
  • 原文地址:https://www.cnblogs.com/storebook/p/11096278.html
Copyright © 2011-2022 走看看