Java-Class-C:org.springframework.http.HttpEntity
| ylbtech-Java-Class-C:org.springframework.http.HttpEntity |
| 1.返回顶部 |
//封装成一个请求对象
HttpEntity entity = new HttpEntity(requestParam, headers);
| 2.返回顶部 |
| 3.返回顶部 |
| 4.返回顶部 |
//
// 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();
}
}
| 5.返回顶部 |
| 6.返回顶部 |
![]() |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
Java-Class-C:org.springframework.http.HttpEntity的更多相关文章
- Spring整合Mybatis报 java.lang.ClassNotFoundException:org.springframework.core.metrics.ApplicationStartup,即:spring的版本过高,采用RELEASE稳定版
1.遇到的问题: 今天在弄spring整合mybatis的时候遇到一个小问题,如图所示: 简单来说:就是我的spring的xml文件没找到,我就奇了怪了,我所有的配置都没问题啊! 我pom.xml配置 ...
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill
异常信息如下: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value ...
- 【spring mvc】后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Specified class is an interface
后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate ...
- SSM报错:No converter found for return value of type: class java.util.ArrayList at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverter
我使用的是SSM框架,是在编写测试RESTFUL接口的时候出现, @RequestMapping(value = "/selectAll", method = RequestMet ...
- Java-Class-C:org.springframework.http.ResponseEntity
ylbtech-Java-Class-C:org.springframework.http.ResponseEntity 1.返回顶部 1. org.springframework.http Clas ...
- Java-Class-C:org.springframework.web.client.RestTemplate
ylbtech-Java-Class-C:org.springframework.web.client.RestTemplate 1.返回顶部 1. org.springframework.web.c ...
- Java Web系列:Spring Boot 基础
Spring Boot 项目(参考1) 提供了一个类似ASP.NET MVC的默认模板一样的标准样板,直接集成了一系列的组件并使用了默认的配置.使用Spring Boot 不会降低学习成本,甚至增加了 ...
- Java Web系列:Spring Boot 基础 (转)
Spring Boot 项目(参考1) 提供了一个类似ASP.NET MVC的默认模板一样的标准样板,直接集成了一系列的组件并使用了默认的配置.使用Spring Boot 不会降低学习成本,甚至增加了 ...
- Spring MVC报异常:org.springframework.web.util.NestedServletException: Request processing failed
在使用SpringMVC绑定基本类型(如String,Integer等)参数时,应通过@RequestParam注解指定具体的参数名称,否则,当源代码在非debug模式下编译后,运行时会引发Handl ...
随机推荐
- Jenkins应用
转自 https://www.cnblogs.com/syw20170419/category/1239520.html Jenkins+Git+Python 进行持续集成接口测试 https://w ...
- JPA中遇到一些异常的分析与解决
Spring Data JPA踩坑到填坑:1 JPA多对多关 //作者表 //书籍表 Book和Author是多对多关系 先放两张图做个说明:Jpa底层依赖于hibernate,hibernate默认 ...
- 使用ionic来build安卓apk时,报CordovaError: Requirements check failed for JDK 1.8 or greater
本地配置了JDK和jre的本地环境变量之后,在命令行中运行Java.javac等都能正常输出,但是在使用ionic cordova build android 来打包ionic的程序时,会提示 Cor ...
- 如何在一个for语句中迭代多个对象(2.7)
如何在一个for语句中迭代多个对象 总结: 并行迭代使用zip(l1, l2, l3) 每次迭代从3个列表里各取一个数据 串行迭代使用itertools.chain(l1, l2, l3) 相当于把3 ...
- 关于iframe定位碰到的问题。
这几天在做自动化测试的时候发现一个问题,用JQUERY定位时,总是报错,MES:JQUERY IS NOT DEFINED. 检查自己定位没有问题,后来想是不是语法出了问题. 切换成XPATH来定位, ...
- 12、testng.xml指定运行测试包、测试类、测试方法
目录如下: TestFixture.java 代码如下: package com.testng.cn; import org.testng.annotations.*; public class Te ...
- Codeforces 1172A Nauuo and Cards
题目链接:http://codeforces.com/problemset/problem/1172/A 题意:一共有2*n张牌,n张0,n张1到n.现在随机的n张(有0有数字)在手上,另n张再牌堆中 ...
- Git 学习第二天(一)
继续昨天的学习. 回顾一下,昨天我们安装了git 并创建了登录名及邮箱,还向git仓库提交了一个readme.txt的文本文件 下面,我们来修改下这个文件,将内容改为 Git is a distrib ...
- 第十八天:CSV、JSON、Excel、SQLite
一.CSV文件 1.读取 reader = csv.reader(打开的file对象), reader为可迭代对象 2.用namedtuple映射列名 with open('apple.csv') a ...
- Reqests----Get请求之参数化
一.环境安装 >>pip install requests 注意:pip很容易就会版本升级,如果用python3的,请使用pip3 install requests 1.初始化版本 2.把 ...
