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=BlockInfo, data={device=str, type=str, removable=bool, locked=bool, *inserted=BlockDeviceInfo, *tray_open=bool, *io-status=BlockDeviceIoStatus, *dirty-bitmaps=[BlockDirtyInfo]}, innerTypes=null}</pre>
016 */
017// QApiTypeDescriptor{name=BlockInfo, data={device=str, type=str, removable=bool, locked=bool, *inserted=BlockDeviceInfo, *tray_open=bool, *io-status=BlockDeviceIoStatus, *dirty-bitmaps=[BlockDirtyInfo]}, innerTypes=null}
018@JsonInclude(JsonInclude.Include.NON_EMPTY)
019public class BlockInfo extends QApiType {
020
021        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
022        @JsonProperty("device")
023        @Nonnull
024        public java.lang.String device;
025        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
026        @JsonProperty("type")
027        @Nonnull
028        public java.lang.String type;
029        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
030        @JsonProperty("removable")
031        @Nonnull
032        public boolean removable;
033        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
034        @JsonProperty("locked")
035        @Nonnull
036        public boolean locked;
037        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
038        @JsonProperty("inserted")
039        @CheckForNull
040        public BlockDeviceInfo inserted;
041        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
042        @JsonProperty("tray_open")
043        @CheckForNull
044        public java.lang.Boolean trayOpen;
045        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
046        @JsonProperty("io-status")
047        @CheckForNull
048        public BlockDeviceIoStatus ioStatus;
049        @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
050        @JsonProperty("dirty-bitmaps")
051        @CheckForNull
052        public java.util.List<BlockDirtyInfo> dirtyBitmaps;
053
054        @Nonnull
055        public BlockInfo withDevice(java.lang.String value) {
056                this.device = value;
057                return this;
058        }
059
060        @Nonnull
061        public BlockInfo withType(java.lang.String value) {
062                this.type = value;
063                return this;
064        }
065
066        @Nonnull
067        public BlockInfo withRemovable(boolean value) {
068                this.removable = value;
069                return this;
070        }
071
072        @Nonnull
073        public BlockInfo withLocked(boolean value) {
074                this.locked = value;
075                return this;
076        }
077
078        @Nonnull
079        public BlockInfo withInserted(BlockDeviceInfo value) {
080                this.inserted = value;
081                return this;
082        }
083
084        @Nonnull
085        public BlockInfo withTrayOpen(java.lang.Boolean value) {
086                this.trayOpen = value;
087                return this;
088        }
089
090        @Nonnull
091        public BlockInfo withIoStatus(BlockDeviceIoStatus value) {
092                this.ioStatus = value;
093                return this;
094        }
095
096        @Nonnull
097        public BlockInfo withDirtyBitmaps(java.util.List<BlockDirtyInfo> value) {
098                this.dirtyBitmaps = value;
099                return this;
100        }
101
102        public BlockInfo() {
103        }
104
105        public BlockInfo(java.lang.String device, java.lang.String type, boolean removable, boolean locked, BlockDeviceInfo inserted, java.lang.Boolean trayOpen, BlockDeviceIoStatus ioStatus, java.util.List<BlockDirtyInfo> dirtyBitmaps) {
106                this.device = device;
107                this.type = type;
108                this.removable = removable;
109                this.locked = locked;
110                this.inserted = inserted;
111                this.trayOpen = trayOpen;
112                this.ioStatus = ioStatus;
113                this.dirtyBitmaps = dirtyBitmaps;
114        }
115
116        @JsonIgnore
117        @Override
118        public java.util.List<java.lang.String> getFieldNames() {
119                java.util.List<java.lang.String> names = super.getFieldNames();
120                names.add("device");
121                names.add("type");
122                names.add("removable");
123                names.add("locked");
124                names.add("inserted");
125                names.add("tray_open");
126                names.add("io-status");
127                names.add("dirty-bitmaps");
128                return names;
129        }
130
131        @Override
132        public Object getFieldByName(@Nonnull java.lang.String name) throws NoSuchFieldException {
133                if ("device".equals(name))
134                        return device;
135                if ("type".equals(name))
136                        return type;
137                if ("removable".equals(name))
138                        return removable;
139                if ("locked".equals(name))
140                        return locked;
141                if ("inserted".equals(name))
142                        return inserted;
143                if ("tray_open".equals(name))
144                        return trayOpen;
145                if ("io-status".equals(name))
146                        return ioStatus;
147                if ("dirty-bitmaps".equals(name))
148                        return dirtyBitmaps;
149                return super.getFieldByName(name);
150        }
151}