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=InetSocketAddress, data={host=str, port=str, *to=uint16, *ipv4=bool, *ipv6=bool}, innerTypes=null}</pre> 016 */ 017// QApiTypeDescriptor{name=InetSocketAddress, data={host=str, port=str, *to=uint16, *ipv4=bool, *ipv6=bool}, innerTypes=null} 018@JsonInclude(JsonInclude.Include.NON_EMPTY) 019public class InetSocketAddress extends QApiType { 020 021 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 022 @JsonProperty("host") 023 @Nonnull 024 public java.lang.String host; 025 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 026 @JsonProperty("port") 027 @Nonnull 028 public java.lang.String port; 029 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 030 @JsonProperty("to") 031 @CheckForNull 032 public java.lang.Integer to; 033 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 034 @JsonProperty("ipv4") 035 @CheckForNull 036 public java.lang.Boolean ipv4; 037 @SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") 038 @JsonProperty("ipv6") 039 @CheckForNull 040 public java.lang.Boolean ipv6; 041 042 @Nonnull 043 public InetSocketAddress withHost(java.lang.String value) { 044 this.host = value; 045 return this; 046 } 047 048 @Nonnull 049 public InetSocketAddress withPort(java.lang.String value) { 050 this.port = value; 051 return this; 052 } 053 054 @Nonnull 055 public InetSocketAddress withTo(java.lang.Integer value) { 056 this.to = value; 057 return this; 058 } 059 060 @Nonnull 061 public InetSocketAddress withIpv4(java.lang.Boolean value) { 062 this.ipv4 = value; 063 return this; 064 } 065 066 @Nonnull 067 public InetSocketAddress withIpv6(java.lang.Boolean value) { 068 this.ipv6 = value; 069 return this; 070 } 071 072 public InetSocketAddress() { 073 } 074 075 public InetSocketAddress(java.lang.String host, java.lang.String port, java.lang.Integer to, java.lang.Boolean ipv4, java.lang.Boolean ipv6) { 076 this.host = host; 077 this.port = port; 078 this.to = to; 079 this.ipv4 = ipv4; 080 this.ipv6 = ipv6; 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("host"); 088 names.add("port"); 089 names.add("to"); 090 names.add("ipv4"); 091 names.add("ipv6"); 092 return names; 093 } 094 095 @Override 096 public Object getFieldByName(@Nonnull java.lang.String name) throws NoSuchFieldException { 097 if ("host".equals(name)) 098 return host; 099 if ("port".equals(name)) 100 return port; 101 if ("to".equals(name)) 102 return to; 103 if ("ipv4".equals(name)) 104 return ipv4; 105 if ("ipv6".equals(name)) 106 return ipv6; 107 return super.getFieldByName(name); 108 } 109}