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=BlockdevOptionsQcow2, data={*lazy-refcounts=bool, *pass-discard-request=bool, *pass-discard-snapshot=bool, *pass-discard-other=bool, *overlap-check=Qcow2OverlapChecks, *cache-size=int, *l2-cache-size=int, *refcount-cache-size=int, *cache-clean-interval=int}, innerTypes=null}</pre>
016 */
017// QApiTypeDescriptor{name=BlockdevOptionsQcow2, data={*lazy-refcounts=bool, *pass-discard-request=bool, *pass-discard-snapshot=bool, *pass-discard-other=bool, *overlap-check=Qcow2OverlapChecks, *cache-size=int, *l2-cache-size=int, *refcount-cache-size=int, *cache-clean-interval=int}, innerTypes=null}
018@JsonInclude(JsonInclude.Include.NON_EMPTY)
019public class BlockdevOptionsQcow2 extends BlockdevOptionsGenericCOWFormat {
020
021        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
022        @JsonProperty("lazy-refcounts")
023        @CheckForNull
024        public java.lang.Boolean lazyRefcounts;
025        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
026        @JsonProperty("pass-discard-request")
027        @CheckForNull
028        public java.lang.Boolean passDiscardRequest;
029        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
030        @JsonProperty("pass-discard-snapshot")
031        @CheckForNull
032        public java.lang.Boolean passDiscardSnapshot;
033        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
034        @JsonProperty("pass-discard-other")
035        @CheckForNull
036        public java.lang.Boolean passDiscardOther;
037        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
038        @JsonProperty("overlap-check")
039        @CheckForNull
040        public Qcow2OverlapChecks overlapCheck;
041        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
042        @JsonProperty("cache-size")
043        @CheckForNull
044        public java.lang.Long cacheSize;
045        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
046        @JsonProperty("l2-cache-size")
047        @CheckForNull
048        public java.lang.Long l2CacheSize;
049        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
050        @JsonProperty("refcount-cache-size")
051        @CheckForNull
052        public java.lang.Long refcountCacheSize;
053        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
054        @JsonProperty("cache-clean-interval")
055        @CheckForNull
056        public java.lang.Long cacheCleanInterval;
057
058        @Nonnull
059        public BlockdevOptionsQcow2 withLazyRefcounts(java.lang.Boolean value) {
060                this.lazyRefcounts = value;
061                return this;
062        }
063
064        @Nonnull
065        public BlockdevOptionsQcow2 withPassDiscardRequest(java.lang.Boolean value) {
066                this.passDiscardRequest = value;
067                return this;
068        }
069
070        @Nonnull
071        public BlockdevOptionsQcow2 withPassDiscardSnapshot(java.lang.Boolean value) {
072                this.passDiscardSnapshot = value;
073                return this;
074        }
075
076        @Nonnull
077        public BlockdevOptionsQcow2 withPassDiscardOther(java.lang.Boolean value) {
078                this.passDiscardOther = value;
079                return this;
080        }
081
082        @Nonnull
083        public BlockdevOptionsQcow2 withOverlapCheck(Qcow2OverlapChecks value) {
084                this.overlapCheck = value;
085                return this;
086        }
087
088        @Nonnull
089        public BlockdevOptionsQcow2 withCacheSize(java.lang.Long value) {
090                this.cacheSize = value;
091                return this;
092        }
093
094        @Nonnull
095        public BlockdevOptionsQcow2 withL2CacheSize(java.lang.Long value) {
096                this.l2CacheSize = value;
097                return this;
098        }
099
100        @Nonnull
101        public BlockdevOptionsQcow2 withRefcountCacheSize(java.lang.Long value) {
102                this.refcountCacheSize = value;
103                return this;
104        }
105
106        @Nonnull
107        public BlockdevOptionsQcow2 withCacheCleanInterval(java.lang.Long value) {
108                this.cacheCleanInterval = value;
109                return this;
110        }
111
112        public BlockdevOptionsQcow2() {
113        }
114
115        public BlockdevOptionsQcow2(java.lang.Boolean lazyRefcounts, java.lang.Boolean passDiscardRequest, java.lang.Boolean passDiscardSnapshot, java.lang.Boolean passDiscardOther, Qcow2OverlapChecks overlapCheck, java.lang.Long cacheSize, java.lang.Long l2CacheSize, java.lang.Long refcountCacheSize, java.lang.Long cacheCleanInterval) {
116                this.lazyRefcounts = lazyRefcounts;
117                this.passDiscardRequest = passDiscardRequest;
118                this.passDiscardSnapshot = passDiscardSnapshot;
119                this.passDiscardOther = passDiscardOther;
120                this.overlapCheck = overlapCheck;
121                this.cacheSize = cacheSize;
122                this.l2CacheSize = l2CacheSize;
123                this.refcountCacheSize = refcountCacheSize;
124                this.cacheCleanInterval = cacheCleanInterval;
125        }
126
127        @JsonIgnore
128        @Override
129        public java.util.List<java.lang.String> getFieldNames() {
130                java.util.List<java.lang.String> names = super.getFieldNames();
131                names.add("lazy-refcounts");
132                names.add("pass-discard-request");
133                names.add("pass-discard-snapshot");
134                names.add("pass-discard-other");
135                names.add("overlap-check");
136                names.add("cache-size");
137                names.add("l2-cache-size");
138                names.add("refcount-cache-size");
139                names.add("cache-clean-interval");
140                return names;
141        }
142
143        @Override
144        public Object getFieldByName(@Nonnull java.lang.String name) throws NoSuchFieldException {
145                if ("lazy-refcounts".equals(name))
146                        return lazyRefcounts;
147                if ("pass-discard-request".equals(name))
148                        return passDiscardRequest;
149                if ("pass-discard-snapshot".equals(name))
150                        return passDiscardSnapshot;
151                if ("pass-discard-other".equals(name))
152                        return passDiscardOther;
153                if ("overlap-check".equals(name))
154                        return overlapCheck;
155                if ("cache-size".equals(name))
156                        return cacheSize;
157                if ("l2-cache-size".equals(name))
158                        return l2CacheSize;
159                if ("refcount-cache-size".equals(name))
160                        return refcountCacheSize;
161                if ("cache-clean-interval".equals(name))
162                        return cacheCleanInterval;
163                return super.getFieldByName(name);
164        }
165}