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=BlockdevOptionsBase, data={driver=BlockdevDriver, *id=str, *node-name=str, *discard=BlockdevDiscardOptions, *cache=BlockdevCacheOptions, *aio=BlockdevAioOptions, *rerror=BlockdevOnError, *werror=BlockdevOnError, *read-only=bool, *stats-account-invalid=bool, *stats-account-failed=bool, *stats-intervals=[int], *detect-zeroes=BlockdevDetectZeroesOptions}, innerTypes=null}</pre> 016 */ 017// QApiTypeDescriptor{name=BlockdevOptionsBase, data={driver=BlockdevDriver, *id=str, *node-name=str, *discard=BlockdevDiscardOptions, *cache=BlockdevCacheOptions, *aio=BlockdevAioOptions, *rerror=BlockdevOnError, *werror=BlockdevOnError, *read-only=bool, *stats-account-invalid=bool, *stats-account-failed=bool, *stats-intervals=[int], *detect-zeroes=BlockdevDetectZeroesOptions}, innerTypes=null} 018@JsonInclude(JsonInclude.Include.NON_EMPTY) 019public class BlockdevOptionsBase extends QApiType { 020 021 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 022 @JsonProperty("driver") 023 @Nonnull 024 public BlockdevDriver driver; 025 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 026 @JsonProperty("id") 027 @CheckForNull 028 public java.lang.String id; 029 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 030 @JsonProperty("node-name") 031 @CheckForNull 032 public java.lang.String nodeName; 033 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 034 @JsonProperty("discard") 035 @CheckForNull 036 public BlockdevDiscardOptions discard; 037 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 038 @JsonProperty("cache") 039 @CheckForNull 040 public BlockdevCacheOptions cache; 041 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 042 @JsonProperty("aio") 043 @CheckForNull 044 public BlockdevAioOptions aio; 045 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 046 @JsonProperty("rerror") 047 @CheckForNull 048 public BlockdevOnError rerror; 049 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 050 @JsonProperty("werror") 051 @CheckForNull 052 public BlockdevOnError werror; 053 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 054 @JsonProperty("read-only") 055 @CheckForNull 056 public java.lang.Boolean readOnly; 057 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 058 @JsonProperty("stats-account-invalid") 059 @CheckForNull 060 public java.lang.Boolean statsAccountInvalid; 061 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 062 @JsonProperty("stats-account-failed") 063 @CheckForNull 064 public java.lang.Boolean statsAccountFailed; 065 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 066 @JsonProperty("stats-intervals") 067 @CheckForNull 068 public java.util.List<java.lang.Long> statsIntervals; 069 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 070 @JsonProperty("detect-zeroes") 071 @CheckForNull 072 public BlockdevDetectZeroesOptions detectZeroes; 073 074 @Nonnull 075 public BlockdevOptionsBase withDriver(BlockdevDriver value) { 076 this.driver = value; 077 return this; 078 } 079 080 @Nonnull 081 public BlockdevOptionsBase withId(java.lang.String value) { 082 this.id = value; 083 return this; 084 } 085 086 @Nonnull 087 public BlockdevOptionsBase withNodeName(java.lang.String value) { 088 this.nodeName = value; 089 return this; 090 } 091 092 @Nonnull 093 public BlockdevOptionsBase withDiscard(BlockdevDiscardOptions value) { 094 this.discard = value; 095 return this; 096 } 097 098 @Nonnull 099 public BlockdevOptionsBase withCache(BlockdevCacheOptions value) { 100 this.cache = value; 101 return this; 102 } 103 104 @Nonnull 105 public BlockdevOptionsBase withAio(BlockdevAioOptions value) { 106 this.aio = value; 107 return this; 108 } 109 110 @Nonnull 111 public BlockdevOptionsBase withRerror(BlockdevOnError value) { 112 this.rerror = value; 113 return this; 114 } 115 116 @Nonnull 117 public BlockdevOptionsBase withWerror(BlockdevOnError value) { 118 this.werror = value; 119 return this; 120 } 121 122 @Nonnull 123 public BlockdevOptionsBase withReadOnly(java.lang.Boolean value) { 124 this.readOnly = value; 125 return this; 126 } 127 128 @Nonnull 129 public BlockdevOptionsBase withStatsAccountInvalid(java.lang.Boolean value) { 130 this.statsAccountInvalid = value; 131 return this; 132 } 133 134 @Nonnull 135 public BlockdevOptionsBase withStatsAccountFailed(java.lang.Boolean value) { 136 this.statsAccountFailed = value; 137 return this; 138 } 139 140 @Nonnull 141 public BlockdevOptionsBase withStatsIntervals(java.util.List<java.lang.Long> value) { 142 this.statsIntervals = value; 143 return this; 144 } 145 146 @Nonnull 147 public BlockdevOptionsBase withDetectZeroes(BlockdevDetectZeroesOptions value) { 148 this.detectZeroes = value; 149 return this; 150 } 151 152 public BlockdevOptionsBase() { 153 } 154 155 public BlockdevOptionsBase(BlockdevDriver driver, java.lang.String id, java.lang.String nodeName, BlockdevDiscardOptions discard, BlockdevCacheOptions cache, BlockdevAioOptions aio, BlockdevOnError rerror, BlockdevOnError werror, java.lang.Boolean readOnly, java.lang.Boolean statsAccountInvalid, java.lang.Boolean statsAccountFailed, java.util.List<java.lang.Long> statsIntervals, BlockdevDetectZeroesOptions detectZeroes) { 156 this.driver = driver; 157 this.id = id; 158 this.nodeName = nodeName; 159 this.discard = discard; 160 this.cache = cache; 161 this.aio = aio; 162 this.rerror = rerror; 163 this.werror = werror; 164 this.readOnly = readOnly; 165 this.statsAccountInvalid = statsAccountInvalid; 166 this.statsAccountFailed = statsAccountFailed; 167 this.statsIntervals = statsIntervals; 168 this.detectZeroes = detectZeroes; 169 } 170 171 @JsonIgnore 172 @Override 173 public java.util.List<java.lang.String> getFieldNames() { 174 java.util.List<java.lang.String> names = super.getFieldNames(); 175 names.add("driver"); 176 names.add("id"); 177 names.add("node-name"); 178 names.add("discard"); 179 names.add("cache"); 180 names.add("aio"); 181 names.add("rerror"); 182 names.add("werror"); 183 names.add("read-only"); 184 names.add("stats-account-invalid"); 185 names.add("stats-account-failed"); 186 names.add("stats-intervals"); 187 names.add("detect-zeroes"); 188 return names; 189 } 190 191 @Override 192 public Object getFieldByName(@Nonnull java.lang.String name) throws NoSuchFieldException { 193 if ("driver".equals(name)) 194 return driver; 195 if ("id".equals(name)) 196 return id; 197 if ("node-name".equals(name)) 198 return nodeName; 199 if ("discard".equals(name)) 200 return discard; 201 if ("cache".equals(name)) 202 return cache; 203 if ("aio".equals(name)) 204 return aio; 205 if ("rerror".equals(name)) 206 return rerror; 207 if ("werror".equals(name)) 208 return werror; 209 if ("read-only".equals(name)) 210 return readOnly; 211 if ("stats-account-invalid".equals(name)) 212 return statsAccountInvalid; 213 if ("stats-account-failed".equals(name)) 214 return statsAccountFailed; 215 if ("stats-intervals".equals(name)) 216 return statsIntervals; 217 if ("detect-zeroes".equals(name)) 218 return detectZeroes; 219 return super.getFieldByName(name); 220 } 221}