| 188 | } |
| 189 | |
| 190 | public Map<String, Object> toMap() { |
| 191 | Map<String, Object> map = new HashMap<>(); |
| 192 | map.put("name", getName()); |
| 193 | map.put("value", getValue().toMap()); |
| 194 | if (domain != null) map.put("domain", domain); |
| 195 | if (path != null) map.put("path", path); |
| 196 | if (size != null) map.put("size", size); |
| 197 | map.put("secure", isSecure()); |
| 198 | map.put("httpOnly", isHttpOnly()); |
| 199 | if (sameSite != null) map.put("sameSite", sameSite.toString()); |
| 200 | expiry.ifPresent(expiry -> map.put("expiry", expiry)); |
| 201 | return unmodifiableMap(map); |
| 202 | } |
| 203 | } |