package org.anarres.qemu.qapi.api;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import org.anarres.qemu.qapi.common.*;

/**
 * Autogenerated class.
 *
 * <pre>QApiStructDescriptor{name=NFSServer, data={type=NFSTransport, host=str}, innerTypes=null, fields=null, base=null}</pre>
 */
// QApiStructDescriptor{name=NFSServer, data={type=NFSTransport, host=str}, innerTypes=null, fields=null, base=null}
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class NFSServer extends QApiType {

	@SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
	@JsonProperty("type")
	@Nonnull
	public NFSTransport type;
	@SuppressFBWarnings("NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
	@JsonProperty("host")
	@Nonnull
	public java.lang.String host;

	@Nonnull
	public NFSServer withType(NFSTransport value) {
		this.type = value;
		return this;
	}

	@Nonnull
	public NFSServer withHost(java.lang.String value) {
		this.host = value;
		return this;
	}

	public NFSServer() {
	}

	public NFSServer(NFSTransport type, java.lang.String host) {
		this.type = type;
		this.host = host;
	}

	@JsonIgnore
	@Override
	public java.util.List<java.lang.String> getFieldNames() {
		java.util.List<java.lang.String> names = super.getFieldNames();
		names.add("type");
		names.add("host");
		return names;
	}

	@Override
	public Object getFieldByName(@Nonnull java.lang.String name) throws NoSuchFieldException {
		if ("type".equals(name))
			return type;
		if ("host".equals(name))
			return host;
		return super.getFieldByName(name);
	}
}
