Files
pinpoint/src/main/java/com/nhn/pinpoint/web/service/ComplexNodeId.java
T

74 lines
1.7 KiB
Java

package com.nhn.pinpoint.web.service;
/**
* @author emeroad
*/
public class ComplexNodeId implements NodeId {
private Node src;
private Node dest;
public ComplexNodeId(Node src, Node dest) {
if (src == null) {
throw new NullPointerException("src must not be null");
}
if (dest == null) {
throw new NullPointerException("dest must not be null");
}
this.src = src;
this.dest = dest;
}
public Node getSrc() {
return src;
}
public void setSrc(Node src) {
if (src == null) {
throw new NullPointerException("src must not be null");
}
this.src = src;
}
public Node getDest() {
return dest;
}
public void setDest(Node dest) {
if (dest == null) {
throw new NullPointerException("dest must not be null");
}
this.dest = dest;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ComplexNodeId that = (ComplexNodeId) o;
if (!dest.equals(that.dest)) return false;
if (!src.equals(that.src)) return false;
return true;
}
@Override
public int hashCode() {
int result = src.hashCode();
result = 31 * result + dest.hashCode();
return result;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("ComplexNodeId{");
sb.append("src=").append(src);
sb.append(", dest=").append(dest);
sb.append('}');
return sb.toString();
}
}