MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / toJson

Method toJson

java/src/org/openqa/selenium/Cookie.java:235–266  ·  view source on GitHub ↗

JSON object keys are defined in https://w3c.github.io/webdriver/#dfn-table-for-cookie-conversion.

()

Source from the content-addressed store, hash-verified

233 * https://w3c.github.io/webdriver/#dfn-table-for-cookie-conversion.
234 */
235 public Map<String, Object> toJson() {
236 Map<String, Object> toReturn = new TreeMap<>();
237
238 if (getDomain() != null) {
239 toReturn.put("domain", getDomain());
240 }
241
242 if (getExpiry() != null) {
243 toReturn.put("expiry", getExpiry());
244 }
245
246 if (getName() != null) {
247 toReturn.put("name", getName());
248 }
249
250 if (getPath() != null) {
251 toReturn.put("path", getPath());
252 }
253
254 if (getValue() != null) {
255 toReturn.put("value", getValue());
256 }
257
258 toReturn.put("secure", isSecure());
259 toReturn.put("httpOnly", isHttpOnly());
260
261 if (getSameSite() != null) {
262 toReturn.put("sameSite", getSameSite());
263 }
264
265 return toReturn;
266 }
267
268 @Override
269 public String toString() {

Calls 9

getDomainMethod · 0.95
getExpiryMethod · 0.95
getNameMethod · 0.95
getPathMethod · 0.95
getValueMethod · 0.95
isSecureMethod · 0.95
isHttpOnlyMethod · 0.95
getSameSiteMethod · 0.95
putMethod · 0.65

Tested by 1