Home / Class/ DnsCacheEntryList Class — netty Architecture

DnsCacheEntryList Class — netty Architecture

Architecture documentation for the DnsCacheEntryList class in DefaultDnsCache.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  ab7f7794_c2b0_f700_d2ad_7234022c9c0f["DnsCacheEntryList"]
  ec7ccb1d_9656_967e_1bb5_7061ec67e67d["DefaultDnsCache.java"]
  ab7f7794_c2b0_f700_d2ad_7234022c9c0f -->|defined in| ec7ccb1d_9656_967e_1bb5_7061ec67e67d
  e6a0ddc9_5bc2_ce16_6661_fd0f7c52a4e4["DnsCacheEntryList()"]
  ab7f7794_c2b0_f700_d2ad_7234022c9c0f -->|method| e6a0ddc9_5bc2_ce16_6661_fd0f7c52a4e4
  ae5d36e6_30f4_c99e_4519_5cf14fa6d191["DnsCacheEntry()"]
  ab7f7794_c2b0_f700_d2ad_7234022c9c0f -->|method| ae5d36e6_30f4_c99e_4519_5cf14fa6d191
  2e34bcc3_4053_7a77_61ee_c28d0d40e38d["size()"]
  ab7f7794_c2b0_f700_d2ad_7234022c9c0f -->|method| 2e34bcc3_4053_7a77_61ee_c28d0d40e38d
  7ef7a9e6_69fa_e023_90d4_81d8648b2c85["hashCode()"]
  ab7f7794_c2b0_f700_d2ad_7234022c9c0f -->|method| 7ef7a9e6_69fa_e023_90d4_81d8648b2c85
  9bda5d0b_7163_6d9b_07a4_6169128f18e3["equals()"]
  ab7f7794_c2b0_f700_d2ad_7234022c9c0f -->|method| 9bda5d0b_7163_6d9b_07a4_6169128f18e3

Relationship Graph

Source Code

resolver-dns/src/main/java/io/netty/resolver/dns/DefaultDnsCache.java lines 293–328

    private static final class DnsCacheEntryList extends AbstractList<DnsCacheEntry> {
        private final List<? extends DnsCacheEntry> entries;

        DnsCacheEntryList(List<? extends DnsCacheEntry> entries) {
            this.entries = entries;
        }

        @Override
        public DnsCacheEntry get(int index) {
            DefaultDnsCacheEntry entry = (DefaultDnsCacheEntry) entries.get(index);
            // As we dont know what exactly the user is doing with the returned exception (for example
            // using addSuppressed(...) and so hold up a lot of memory until the entry expires) we do
            // create a copy.
            return entry.copyIfNeeded();
        }

        @Override
        public int size() {
            return entries.size();
        }

        @Override
        public int hashCode() {
            // Just delegate to super to make checkstyle happy
            return super.hashCode();
        }

        @Override
        public boolean equals(Object o) {
            if (o instanceof DnsCacheEntryList) {
                // Fast-path.
                return entries.equals(((DnsCacheEntryList) o).entries);
            }
            return super.equals(o);
        }
    };

Frequently Asked Questions

What is the DnsCacheEntryList class?
DnsCacheEntryList is a class in the netty codebase, defined in resolver-dns/src/main/java/io/netty/resolver/dns/DefaultDnsCache.java.
Where is DnsCacheEntryList defined?
DnsCacheEntryList is defined in resolver-dns/src/main/java/io/netty/resolver/dns/DefaultDnsCache.java at line 293.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free