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=DriveBackup, data={device=str, target=str, *format=str, sync=MirrorSyncMode, *mode=NewImageMode, *speed=int, *bitmap=str, *on-source-error=BlockdevOnError, *on-target-error=BlockdevOnError}, innerTypes=null}</pre> 016 */ 017// QApiTypeDescriptor{name=DriveBackup, data={device=str, target=str, *format=str, sync=MirrorSyncMode, *mode=NewImageMode, *speed=int, *bitmap=str, *on-source-error=BlockdevOnError, *on-target-error=BlockdevOnError}, innerTypes=null} 018@JsonInclude(JsonInclude.Include.NON_EMPTY) 019public class DriveBackup 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("target") 027 @Nonnull 028 public java.lang.String target; 029 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 030 @JsonProperty("format") 031 @CheckForNull 032 public java.lang.String format; 033 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 034 @JsonProperty("sync") 035 @Nonnull 036 public MirrorSyncMode sync; 037 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 038 @JsonProperty("mode") 039 @CheckForNull 040 public NewImageMode mode; 041 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 042 @JsonProperty("speed") 043 @CheckForNull 044 public java.lang.Long speed; 045 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 046 @JsonProperty("bitmap") 047 @CheckForNull 048 public java.lang.String bitmap; 049 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 050 @JsonProperty("on-source-error") 051 @CheckForNull 052 public BlockdevOnError onSourceError; 053 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 054 @JsonProperty("on-target-error") 055 @CheckForNull 056 public BlockdevOnError onTargetError; 057 058 @Nonnull 059 public DriveBackup withDevice(java.lang.String value) { 060 this.device = value; 061 return this; 062 } 063 064 @Nonnull 065 public DriveBackup withTarget(java.lang.String value) { 066 this.target = value; 067 return this; 068 } 069 070 @Nonnull 071 public DriveBackup withFormat(java.lang.String value) { 072 this.format = value; 073 return this; 074 } 075 076 @Nonnull 077 public DriveBackup withSync(MirrorSyncMode value) { 078 this.sync = value; 079 return this; 080 } 081 082 @Nonnull 083 public DriveBackup withMode(NewImageMode value) { 084 this.mode = value; 085 return this; 086 } 087 088 @Nonnull 089 public DriveBackup withSpeed(java.lang.Long value) { 090 this.speed = value; 091 return this; 092 } 093 094 @Nonnull 095 public DriveBackup withBitmap(java.lang.String value) { 096 this.bitmap = value; 097 return this; 098 } 099 100 @Nonnull 101 public DriveBackup withOnSourceError(BlockdevOnError value) { 102 this.onSourceError = value; 103 return this; 104 } 105 106 @Nonnull 107 public DriveBackup withOnTargetError(BlockdevOnError value) { 108 this.onTargetError = value; 109 return this; 110 } 111 112 public DriveBackup() { 113 } 114 115 public DriveBackup(java.lang.String device, java.lang.String target, java.lang.String format, MirrorSyncMode sync, NewImageMode mode, java.lang.Long speed, java.lang.String bitmap, BlockdevOnError onSourceError, BlockdevOnError onTargetError) { 116 this.device = device; 117 this.target = target; 118 this.format = format; 119 this.sync = sync; 120 this.mode = mode; 121 this.speed = speed; 122 this.bitmap = bitmap; 123 this.onSourceError = onSourceError; 124 this.onTargetError = onTargetError; 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("device"); 132 names.add("target"); 133 names.add("format"); 134 names.add("sync"); 135 names.add("mode"); 136 names.add("speed"); 137 names.add("bitmap"); 138 names.add("on-source-error"); 139 names.add("on-target-error"); 140 return names; 141 } 142 143 @Override 144 public Object getFieldByName(@Nonnull java.lang.String name) throws NoSuchFieldException { 145 if ("device".equals(name)) 146 return device; 147 if ("target".equals(name)) 148 return target; 149 if ("format".equals(name)) 150 return format; 151 if ("sync".equals(name)) 152 return sync; 153 if ("mode".equals(name)) 154 return mode; 155 if ("speed".equals(name)) 156 return speed; 157 if ("bitmap".equals(name)) 158 return bitmap; 159 if ("on-source-error".equals(name)) 160 return onSourceError; 161 if ("on-target-error".equals(name)) 162 return onTargetError; 163 return super.getFieldByName(name); 164 } 165}