All Downloads are FREE. Search and download functionalities are using the official Maven repository.

books.BookForm Maven / Gradle / Ivy

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 
// See http://java.sun.com/xml/jaxb 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2018.03.21 at 04:13:34 AM UTC 
//


package books;

import java.util.TimeZone;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
import com.github.jcustenborder.kafka.connect.xml.Connectable;
import org.apache.kafka.connect.data.Date;
import org.apache.kafka.connect.data.Schema;
import org.apache.kafka.connect.data.SchemaBuilder;
import org.apache.kafka.connect.data.Struct;


/**
 * 

Java class for BookForm complex type. * *

The following schema fragment specifies the expected content contained within this class. * *

 * <complexType name="BookForm">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="author" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="genre" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="price" type="{http://www.w3.org/2001/XMLSchema}float"/>
 *         <element name="pub_date" type="{http://www.w3.org/2001/XMLSchema}date"/>
 *         <element name="review" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "BookForm", propOrder = { "author", "title", "genre", "price", "pubDate", "review" }) public class BookForm implements Connectable { @XmlElement(required = true) protected String author; @XmlElement(required = true) protected String title; @XmlElement(required = true) protected String genre; protected float price; @XmlElement(name = "pub_date", required = true) @XmlSchemaType(name = "date") protected XMLGregorianCalendar pubDate; @XmlElement(required = true) protected String review; @XmlAttribute(name = "id") protected String id; public final static Schema CONNECT_SCHEMA; static { SchemaBuilder builder = SchemaBuilder.struct(); builder.name("books.BookForm"); builder.optional(); SchemaBuilder fieldBuilder; fieldBuilder = SchemaBuilder.string(); builder.field("author", fieldBuilder.build()); fieldBuilder = SchemaBuilder.string(); builder.field("title", fieldBuilder.build()); fieldBuilder = SchemaBuilder.string(); builder.field("genre", fieldBuilder.build()); fieldBuilder = SchemaBuilder.float32(); fieldBuilder.optional(); builder.field("price", fieldBuilder.build()); fieldBuilder = Date.builder(); builder.field("pub_date", fieldBuilder.build()); fieldBuilder = SchemaBuilder.string(); builder.field("review", fieldBuilder.build()); fieldBuilder = SchemaBuilder.string(); fieldBuilder.optional(); builder.field("id", fieldBuilder.build()); CONNECT_SCHEMA = builder.build(); } /** * Gets the value of the author property. * * @return * possible object is * {@link String } * */ public String getAuthor() { return author; } /** * Sets the value of the author property. * * @param value * allowed object is * {@link String } * */ public void setAuthor(String value) { this.author = value; } /** * Gets the value of the title property. * * @return * possible object is * {@link String } * */ public String getTitle() { return title; } /** * Sets the value of the title property. * * @param value * allowed object is * {@link String } * */ public void setTitle(String value) { this.title = value; } /** * Gets the value of the genre property. * * @return * possible object is * {@link String } * */ public String getGenre() { return genre; } /** * Sets the value of the genre property. * * @param value * allowed object is * {@link String } * */ public void setGenre(String value) { this.genre = value; } /** * Gets the value of the price property. * */ public float getPrice() { return price; } /** * Sets the value of the price property. * */ public void setPrice(float value) { this.price = value; } /** * Gets the value of the pubDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getPubDate() { return pubDate; } /** * Sets the value of the pubDate property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setPubDate(XMLGregorianCalendar value) { this.pubDate = value; } /** * Gets the value of the review property. * * @return * possible object is * {@link String } * */ public String getReview() { return review; } /** * Sets the value of the review property. * * @param value * allowed object is * {@link String } * */ public void setReview(String value) { this.review = value; } /** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link String } * */ public void setId(String value) { this.id = value; } @Override public Struct toConnectStruct() { Struct struct = new Struct(CONNECT_SCHEMA); struct.put("author", this.getAuthor()); struct.put("title", this.getTitle()); struct.put("genre", this.getGenre()); struct.put("price", this.getPrice()); if (null!= this.getPubDate()) { struct.put("pub_date", this.getPubDate().toGregorianCalendar(TimeZone.getTimeZone("UTC"), null, null).getTime()); } else { struct.put("pub_date", null); } struct.put("review", this.getReview()); struct.put("id", this.getId()); return struct; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy