|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2019 the original author or authors. |
| 2 | + * Copyright 2002-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
22 | 22 |
|
23 | 23 | import javax.servlet.http.Cookie;
|
24 | 24 |
|
| 25 | +import org.springframework.core.style.ToStringCreator; |
25 | 26 | import org.springframework.lang.Nullable;
|
26 | 27 | import org.springframework.util.Assert;
|
27 | 28 | import org.springframework.util.StringUtils;
|
@@ -152,4 +153,22 @@ private static String extractAttributeValue(String attribute, String header) {
|
152 | 153 | return nameAndValue[1];
|
153 | 154 | }
|
154 | 155 |
|
| 156 | + @Override |
| 157 | + public String toString() { |
| 158 | + return new ToStringCreator(this) |
| 159 | + .append("name", getName()) |
| 160 | + .append("value", getValue()) |
| 161 | + .append("Path", getPath()) |
| 162 | + .append("Domain", getDomain()) |
| 163 | + .append("Version", getVersion()) |
| 164 | + .append("Comment", getComment()) |
| 165 | + .append("Secure", getSecure()) |
| 166 | + .append("HttpOnly", isHttpOnly()) |
| 167 | + .append("SameSite", this.sameSite) |
| 168 | + .append("Max-Age", getMaxAge()) |
| 169 | + .append("Expires", (this.expires != null ? |
| 170 | + DateTimeFormatter.RFC_1123_DATE_TIME.format(this.expires) : null)) |
| 171 | + .toString(); |
| 172 | + } |
| 173 | + |
155 | 174 | }
|
0 commit comments