1 /* 2 * CSVeed (https://github.com/42BV/CSVeed) 3 * 4 * Copyright 2013-2023 CSVeed. 5 * 6 * All rights reserved. This program and the accompanying materials 7 * are made available under the terms of The Apache Software License, 8 * Version 2.0 which accompanies this distribution, and is available at 9 * https://www.apache.org/licenses/LICENSE-2.0.txt 10 */ 11 package org.csveed.bean; 12 13 import java.util.Collection; 14 15 import org.csveed.row.RowWriter; 16 17 /** 18 * Class for writing Beans. 19 * 20 * @param <T> 21 * the generic type 22 */ 23 public interface BeanWriter<T> { 24 25 /** 26 * Writes a collection of Beans to the table. 27 * 28 * @param beans 29 * beans to write to the table 30 */ 31 void writeBeans(Collection<T> beans); 32 33 /** 34 * Writes a single Bean to the table. 35 * 36 * @param bean 37 * bean to write to the table 38 */ 39 void writeBean(T bean); 40 41 /** 42 * Writes the header of a Bean type to the table. 43 */ 44 void writeHeader(); 45 46 /** 47 * Gets the row writer. 48 * 49 * @return the row writer 50 */ 51 RowWriter getRowWriter(); 52 53 }