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=BlockdevOptionsQuorum, data={*blkverify=bool, children=[BlockdevRef], vote-threshold=int, *rewrite-corrupted=bool, *read-pattern=QuorumReadPattern}, innerTypes=null}</pre> 016 */ 017// QApiTypeDescriptor{name=BlockdevOptionsQuorum, data={*blkverify=bool, children=[BlockdevRef], vote-threshold=int, *rewrite-corrupted=bool, *read-pattern=QuorumReadPattern}, innerTypes=null} 018@JsonInclude(JsonInclude.Include.NON_EMPTY) 019public class BlockdevOptionsQuorum extends QApiType { 020 021 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 022 @JsonProperty("blkverify") 023 @CheckForNull 024 public java.lang.Boolean blkverify; 025 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 026 @JsonProperty("children") 027 @Nonnull 028 public java.util.List<BlockdevRef> children; 029 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 030 @JsonProperty("vote-threshold") 031 @Nonnull 032 public long voteThreshold; 033 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 034 @JsonProperty("rewrite-corrupted") 035 @CheckForNull 036 public java.lang.Boolean rewriteCorrupted; 037 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 038 @JsonProperty("read-pattern") 039 @CheckForNull 040 public QuorumReadPattern readPattern; 041 042 @Nonnull 043 public BlockdevOptionsQuorum withBlkverify(java.lang.Boolean value) { 044 this.blkverify = value; 045 return this; 046 } 047 048 @Nonnull 049 public BlockdevOptionsQuorum withChildren(java.util.List<BlockdevRef> value) { 050 this.children = value; 051 return this; 052 } 053 054 @Nonnull 055 public BlockdevOptionsQuorum withVoteThreshold(long value) { 056 this.voteThreshold = value; 057 return this; 058 } 059 060 @Nonnull 061 public BlockdevOptionsQuorum withRewriteCorrupted(java.lang.Boolean value) { 062 this.rewriteCorrupted = value; 063 return this; 064 } 065 066 @Nonnull 067 public BlockdevOptionsQuorum withReadPattern(QuorumReadPattern value) { 068 this.readPattern = value; 069 return this; 070 } 071 072 public BlockdevOptionsQuorum() { 073 } 074 075 public BlockdevOptionsQuorum(java.lang.Boolean blkverify, java.util.List<BlockdevRef> children, long voteThreshold, java.lang.Boolean rewriteCorrupted, QuorumReadPattern readPattern) { 076 this.blkverify = blkverify; 077 this.children = children; 078 this.voteThreshold = voteThreshold; 079 this.rewriteCorrupted = rewriteCorrupted; 080 this.readPattern = readPattern; 081 } 082 083 @JsonIgnore 084 @Override 085 public java.util.List<java.lang.String> getFieldNames() { 086 java.util.List<java.lang.String> names = super.getFieldNames(); 087 names.add("blkverify"); 088 names.add("children"); 089 names.add("vote-threshold"); 090 names.add("rewrite-corrupted"); 091 names.add("read-pattern"); 092 return names; 093 } 094 095 @Override 096 public Object getFieldByName(@Nonnull java.lang.String name) throws NoSuchFieldException { 097 if ("blkverify".equals(name)) 098 return blkverify; 099 if ("children".equals(name)) 100 return children; 101 if ("vote-threshold".equals(name)) 102 return voteThreshold; 103 if ("rewrite-corrupted".equals(name)) 104 return rewriteCorrupted; 105 if ("read-pattern".equals(name)) 106 return readPattern; 107 return super.getFieldByName(name); 108 } 109}