Package com.oreilly.springdata.batch.item.file

Source Code of com.oreilly.springdata.batch.item.file.ProductFieldSetMapper

/**
*
*/
package com.oreilly.springdata.batch.item.file;

import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.data.hadoop.example.domain.Product;

/**
* @author templth
*
*/
public class ProductFieldSetMapper implements FieldSetMapper<Product> {
  public Product mapFieldSet(FieldSet fieldSet) {
    Product product = new Product();
    product.setId(fieldSet.readString("id"));
    product.setName(fieldSet.readString("name"));
    product.setDescription(fieldSet.readString("description"));
    product.setPrice(fieldSet.readBigDecimal("price"));
    return product;
  }
}
TOP

Related Classes of com.oreilly.springdata.batch.item.file.ProductFieldSetMapper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.