Пример #1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((extraHeaders == null) ? 0 : extraHeaders.hashCode());
   result = prime * result + ((from == null) ? 0 : from.hashCode());
   result = prime * result + ((id == null) ? 0 : id.hashCode());
   result = prime * result + ((to == null) ? 0 : to.hashCode());
   return result;
 }
Пример #2
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   final MsrpPacketImpl other = (MsrpPacketImpl) obj;
   if (extraHeaders == null) {
     if (other.extraHeaders != null) return false;
   } else if (!extraHeaders.equals(other.extraHeaders)) return false;
   if (from == null) {
     if (other.from != null) return false;
   } else if (!from.equals(other.from)) return false;
   if (id == null) {
     if (other.id != null) return false;
   } else if (!id.equals(other.id)) return false;
   if (to == null) {
     if (other.to != null) return false;
   } else if (!to.equals(other.to)) return false;
   return true;
 }
Пример #3
0
 protected byte[] encodeFromTo() {
   return (from.encode() + CRLF + to.encode() + CRLF).getBytes();
 }