001package org.anarres.qemu.qapi.api;
002
003import com.fasterxml.jackson.annotation.JsonIgnore;
004import com.fasterxml.jackson.annotation.JsonInclude;
005import com.fasterxml.jackson.annotation.JsonProperty;
006import com.fasterxml.jackson.annotation.JsonUnwrapped;
007import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
008import javax.annotation.CheckForNull;
009import javax.annotation.Nonnull;
010import org.anarres.qemu.qapi.common.*;
011
012/**
013 * Autogenerated class.
014 *
015 * <pre>QApiTypeDescriptor{name=XBZRLECacheStats, data={cache-size=int, bytes=int, pages=int, cache-miss=int, cache-miss-rate=number, overflow=int}, innerTypes=null}</pre>
016 */
017// QApiTypeDescriptor{name=XBZRLECacheStats, data={cache-size=int, bytes=int, pages=int, cache-miss=int, cache-miss-rate=number, overflow=int}, innerTypes=null}
018@JsonInclude(JsonInclude.Include.NON_EMPTY)
019public class XBZRLECacheStats extends QApiType {
020
021        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
022        @JsonProperty("cache-size")
023        @Nonnull
024        public long cacheSize;
025        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
026        @JsonProperty("bytes")
027        @Nonnull
028        public long bytes;
029        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
030        @JsonProperty("pages")
031        @Nonnull
032        public long pages;
033        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
034        @JsonProperty("cache-miss")
035        @Nonnull
036        public long cacheMiss;
037        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
038        @JsonProperty("cache-miss-rate")
039        @Nonnull
040        public double cacheMissRate;
041        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
042        @JsonProperty("overflow")
043        @Nonnull
044        public long overflow;
045
046        @Nonnull
047        public XBZRLECacheStats withCacheSize(long value) {
048                this.cacheSize = value;
049                return this;
050        }
051
052        @Nonnull
053        public XBZRLECacheStats withBytes(long value) {
054                this.bytes = value;
055                return this;
056        }
057
058        @Nonnull
059        public XBZRLECacheStats withPages(long value) {
060                this.pages = value;
061                return this;
062        }
063
064        @Nonnull
065        public XBZRLECacheStats withCacheMiss(long value) {
066                this.cacheMiss = value;
067                return this;
068        }
069
070        @Nonnull
071        public XBZRLECacheStats withCacheMissRate(double value) {
072                this.cacheMissRate = value;
073                return this;
074        }
075
076        @Nonnull
077        public XBZRLECacheStats withOverflow(long value) {
078                this.overflow = value;
079                return this;
080        }
081
082        public XBZRLECacheStats() {
083        }
084
085        public XBZRLECacheStats(long cacheSize, long bytes, long pages, long cacheMiss, double cacheMissRate, long overflow) {
086                this.cacheSize = cacheSize;
087                this.bytes = bytes;
088                this.pages = pages;
089                this.cacheMiss = cacheMiss;
090                this.cacheMissRate = cacheMissRate;
091                this.overflow = overflow;
092        }
093
094        @JsonIgnore
095        @Override
096        public java.util.List<java.lang.String> getFieldNames() {
097                java.util.List<java.lang.String> names = super.getFieldNames();
098                names.add("cache-size");
099                names.add("bytes");
100                names.add("pages");
101                names.add("cache-miss");
102                names.add("cache-miss-rate");
103                names.add("overflow");
104                return names;
105        }
106
107        @Override
108        public Object getFieldByName(@Nonnull java.lang.String name) throws NoSuchFieldException {
109                if ("cache-size".equals(name))
110                        return cacheSize;
111                if ("bytes".equals(name))
112                        return bytes;
113                if ("pages".equals(name))
114                        return pages;
115                if ("cache-miss".equals(name))
116                        return cacheMiss;
117                if ("cache-miss-rate".equals(name))
118                        return cacheMissRate;
119                if ("overflow".equals(name))
120                        return overflow;
121                return super.getFieldByName(name);
122        }
123}