| 1 package net.javacoding.jspider.api.model; 2 3 7 public class Cookie { 8 9 protected String name; 10 protected String value; 11 protected String domain; 12 protected String path; 13 protected String expires; 14 15 public Cookie(String name, String value) { 16 this.name = name; 17 this.value = value; 18 } 19 20 public Cookie(String name, String value, String domain, String path, String expires) { 21 this(name, value); 22 this.domain = domain; 23 this.path = path; 24 this.expires = expires; 25 } 26 27 public String getName() { 28 return name; 29 } 30 31 public String getValue() { 32 return value; 33 } 34 35 public String getDomain ( ) { 36 return domain; 37 } 38 39 public String getPath ( ) { 40 return path; 41 } 42 43 public String getExpires ( ) { 44 return expires; 45 } 46 47 public boolean equals(Object other) { 48 if (other instanceof Cookie) { 49 Cookie otherCookie = (Cookie) other; 50 if (otherCookie.name.equals(this.name)) { 51 return true; 52 } else { 53 return false; 54 } 55 } else { 56 return false; 57 } 58 } 59 60 public int hashCode() { 61 return name.hashCode(); 62 } 63 } 64 | Popular Tags |