DefaultDnsCacheEntry Class — netty Architecture
Architecture documentation for the DefaultDnsCacheEntry class in DefaultDnsCache.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 8dc0043f_3214_2fca_3124_59e2c351be79["DefaultDnsCacheEntry"] ec7ccb1d_9656_967e_1bb5_7061ec67e67d["DefaultDnsCache.java"] 8dc0043f_3214_2fca_3124_59e2c351be79 -->|defined in| ec7ccb1d_9656_967e_1bb5_7061ec67e67d 528b79fc_d9cc_9686_7d46_8a76d05353ad["DefaultDnsCacheEntry()"] 8dc0043f_3214_2fca_3124_59e2c351be79 -->|method| 528b79fc_d9cc_9686_7d46_8a76d05353ad fab13c13_e975_de9e_8565_12f5cbec7a71["InetAddress()"] 8dc0043f_3214_2fca_3124_59e2c351be79 -->|method| fab13c13_e975_de9e_8565_12f5cbec7a71 41db7378_e6eb_a7d7_291a_6c988ea73202["Throwable()"] 8dc0043f_3214_2fca_3124_59e2c351be79 -->|method| 41db7378_e6eb_a7d7_291a_6c988ea73202 31348dd1_5c42_00ef_97a1_6a32af42f700["String()"] 8dc0043f_3214_2fca_3124_59e2c351be79 -->|method| 31348dd1_5c42_00ef_97a1_6a32af42f700 154bcab8_1cdf_22cf_23cc_bed64063be4d["hashCode()"] 8dc0043f_3214_2fca_3124_59e2c351be79 -->|method| 154bcab8_1cdf_22cf_23cc_bed64063be4d f91ab843_24a6_88f0_4764_0c309a6519f9["equals()"] 8dc0043f_3214_2fca_3124_59e2c351be79 -->|method| f91ab843_24a6_88f0_4764_0c309a6519f9 1fca7325_6d07_4aaf_f7a9_4b995cf5e0ad["DnsCacheEntry()"] 8dc0043f_3214_2fca_3124_59e2c351be79 -->|method| 1fca7325_6d07_4aaf_f7a9_4b995cf5e0ad
Relationship Graph
Source Code
resolver-dns/src/main/java/io/netty/resolver/dns/DefaultDnsCache.java lines 185–256
private static final class DefaultDnsCacheEntry implements DnsCacheEntry {
private final String hostname;
private final InetAddress address;
private final Throwable cause;
private final int hash;
DefaultDnsCacheEntry(String hostname, InetAddress address) {
this.hostname = hostname;
this.address = address;
cause = null;
hash = System.identityHashCode(this);
}
DefaultDnsCacheEntry(String hostname, Throwable cause) {
this.hostname = hostname;
this.cause = cause;
address = null;
hash = System.identityHashCode(this);
}
private DefaultDnsCacheEntry(DefaultDnsCacheEntry entry) {
this.hostname = entry.hostname;
if (entry.cause == null) {
this.address = entry.address;
this.cause = null;
} else {
this.address = null;
this.cause = copyThrowable(entry.cause);
}
this.hash = entry.hash;
}
@Override
public InetAddress address() {
return address;
}
@Override
public Throwable cause() {
return cause;
}
String hostname() {
return hostname;
}
@Override
public String toString() {
if (cause != null) {
return hostname + '/' + cause;
} else {
return address.toString();
}
}
@Override
public int hashCode() {
return hash;
}
@Override
public boolean equals(Object obj) {
return (obj instanceof DefaultDnsCacheEntry) && ((DefaultDnsCacheEntry) obj).hash == hash;
}
DnsCacheEntry copyIfNeeded() {
if (cause == null) {
return this;
}
return new DefaultDnsCacheEntry(this);
}
}
Source
Frequently Asked Questions
What is the DefaultDnsCacheEntry class?
DefaultDnsCacheEntry is a class in the netty codebase, defined in resolver-dns/src/main/java/io/netty/resolver/dns/DefaultDnsCache.java.
Where is DefaultDnsCacheEntry defined?
DefaultDnsCacheEntry is defined in resolver-dns/src/main/java/io/netty/resolver/dns/DefaultDnsCache.java at line 185.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free