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=BlockJobInfo, data={type=str, device=str, len=int, offset=int, busy=bool, paused=bool, speed=int, io-status=BlockDeviceIoStatus, ready=bool}, innerTypes=null}</pre>
016 */
017// QApiTypeDescriptor{name=BlockJobInfo, data={type=str, device=str, len=int, offset=int, busy=bool, paused=bool, speed=int, io-status=BlockDeviceIoStatus, ready=bool}, innerTypes=null}
018@JsonInclude(JsonInclude.Include.NON_EMPTY)
019public class BlockJobInfo extends QApiType {
020
021        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
022        @JsonProperty("type")
023        @Nonnull
024        public java.lang.String type;
025        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
026        @JsonProperty("device")
027        @Nonnull
028        public java.lang.String device;
029        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
030        @JsonProperty("len")
031        @Nonnull
032        public long len;
033        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
034        @JsonProperty("offset")
035        @Nonnull
036        public long offset;
037        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
038        @JsonProperty("busy")
039        @Nonnull
040        public boolean busy;
041        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
042        @JsonProperty("paused")
043        @Nonnull
044        public boolean paused;
045        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
046        @JsonProperty("speed")
047        @Nonnull
048        public long speed;
049        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
050        @JsonProperty("io-status")
051        @Nonnull
052        public BlockDeviceIoStatus ioStatus;
053        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
054        @JsonProperty("ready")
055        @Nonnull
056        public boolean ready;
057
058        @Nonnull
059        public BlockJobInfo withType(java.lang.String value) {
060                this.type = value;
061                return this;
062        }
063
064        @Nonnull
065        public BlockJobInfo withDevice(java.lang.String value) {
066                this.device = value;
067                return this;
068        }
069
070        @Nonnull
071        public BlockJobInfo withLen(long value) {
072                this.len = value;
073                return this;
074        }
075
076        @Nonnull
077        public BlockJobInfo withOffset(long value) {
078                this.offset = value;
079                return this;
080        }
081
082        @Nonnull
083        public BlockJobInfo withBusy(boolean value) {
084                this.busy = value;
085                return this;
086        }
087
088        @Nonnull
089        public BlockJobInfo withPaused(boolean value) {
090                this.paused = value;
091                return this;
092        }
093
094        @Nonnull
095        public BlockJobInfo withSpeed(long value) {
096                this.speed = value;
097                return this;
098        }
099
100        @Nonnull
101        public BlockJobInfo withIoStatus(BlockDeviceIoStatus value) {
102                this.ioStatus = value;
103                return this;
104        }
105
106        @Nonnull
107        public BlockJobInfo withReady(boolean value) {
108                this.ready = value;
109                return this;
110        }
111
112        public BlockJobInfo() {
113        }
114
115        public BlockJobInfo(java.lang.String type, java.lang.String device, long len, long offset, boolean busy, boolean paused, long speed, BlockDeviceIoStatus ioStatus, boolean ready) {
116                this.type = type;
117                this.device = device;
118                this.len = len;
119                this.offset = offset;
120                this.busy = busy;
121                this.paused = paused;
122                this.speed = speed;
123                this.ioStatus = ioStatus;
124                this.ready = ready;
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("type");
132                names.add("device");
133                names.add("len");
134                names.add("offset");
135                names.add("busy");
136                names.add("paused");
137                names.add("speed");
138                names.add("io-status");
139                names.add("ready");
140                return names;
141        }
142
143        @Override
144        public Object getFieldByName(@Nonnull java.lang.String name) throws NoSuchFieldException {
145                if ("type".equals(name))
146                        return type;
147                if ("device".equals(name))
148                        return device;
149                if ("len".equals(name))
150                        return len;
151                if ("offset".equals(name))
152                        return offset;
153                if ("busy".equals(name))
154                        return busy;
155                if ("paused".equals(name))
156                        return paused;
157                if ("speed".equals(name))
158                        return speed;
159                if ("io-status".equals(name))
160                        return ioStatus;
161                if ("ready".equals(name))
162                        return ready;
163                return super.getFieldByName(name);
164        }
165}