001package io.ebeaninternal.dbmigration.ddlgeneration; 002 003/** 004 * Buffer to append generated DDL to. 005 */ 006public interface DdlBuffer { 007 008 /** 009 * Return true if the buffer is empty. 010 */ 011 boolean isEmpty(); 012 013 /** 014 * Append a statement allowing for null or empty statements. 015 */ 016 DdlBuffer appendStatement(String content); 017 018 /** 019 * Append DDL content to the buffer. 020 */ 021 DdlBuffer append(String content); 022 023 /** 024 * Append DDL content to the buffer with space padding. 025 */ 026 DdlBuffer append(String type, int space); 027 028 /** 029 * Append a value that is potentially null or empty and proceed it with a space if so. 030 */ 031 DdlBuffer appendWithSpace(String foreignKeyRestrict); 032 033 /** 034 * Append new line character to the buffer. 035 */ 036 DdlBuffer newLine(); 037 038 /** 039 * Append the end of statement content. 040 */ 041 DdlBuffer endOfStatement(); 042 043 /** 044 * End of a change - add some whitespace. 045 */ 046 DdlBuffer end(); 047 048 /** 049 * Return the buffer content. 050 */ 051 String getBuffer(); 052 053}