Skip to content

Commit

Permalink
Add constructor methods for CSV converter (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
fh-ms authored Sep 6, 2024
1 parent 83e1210 commit b7124c0
Showing 1 changed file with 79 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import org.eclipse.serializer.afs.types.ADirectory;
import org.eclipse.serializer.afs.types.AFS;
import org.eclipse.serializer.afs.types.AFile;
import org.eclipse.serializer.afs.types.AReadableFile;
Expand Down Expand Up @@ -109,6 +110,84 @@ public String mapTypeName(final PersistenceTypeDescriptionMember columnType)
};
}


/**
* Pseudo-constructor method to create a new {@link StorageDataConverterTypeBinaryToCsv}.
*
* @param targetDirectory write target directory
* @param typeDictionary the type dictionary to use
* @return a new {@link StorageDataConverterTypeBinaryToCsv}
*/
public static StorageDataConverterTypeBinaryToCsv New(
final ADirectory targetDirectory,
final PersistenceTypeDictionary typeDictionary
)
{
return New(
StorageDataConverterCsvConfiguration.defaultConfiguration(),
new StorageEntityTypeConversionFileProvider.Default(
targetDirectory,
"csv"
),
typeDictionary
);
}


/**
* Pseudo-constructor method to create a new {@link StorageDataConverterTypeBinaryToCsv}.
*
* @param configuration the CSV configuration to use
* @param fileProvider target file provider
* @param typeDictionary the type dictionary to use
* @return a new {@link StorageDataConverterTypeBinaryToCsv}
*/
public static StorageDataConverterTypeBinaryToCsv New(
final StorageDataConverterCsvConfiguration configuration ,
final StorageEntityTypeConversionFileProvider fileProvider ,
final PersistenceTypeDictionary typeDictionary
)
{
return New(
configuration ,
fileProvider ,
typeDictionary,
null ,
0 ,
0
);
}


/**
* Pseudo-constructor method to create a new {@link StorageDataConverterTypeBinaryToCsv}.
*
* @param configuration the CSV configuration to use
* @param fileProvider target file provider
* @param typeDictionary the type dictionary to use
* @param typeNameMapper optional type name mapper
* @param readBufferSize buffer size for reading
* @param writeBufferSize buffer size for writing
* @return a new {@link StorageDataConverterTypeBinaryToCsv}
*/
public static StorageDataConverterTypeBinaryToCsv New(
final StorageDataConverterCsvConfiguration configuration ,
final StorageEntityTypeConversionFileProvider fileProvider ,
final PersistenceTypeDictionary typeDictionary ,
final TypeNameMapper typeNameMapper ,
final int readBufferSize ,
final int writeBufferSize
)
{
return new StorageDataConverterTypeBinaryToCsv.UTF8(
configuration ,
fileProvider ,
typeDictionary ,
typeNameMapper ,
readBufferSize ,
writeBufferSize
);
}


public final class UTF8
Expand Down

0 comments on commit b7124c0

Please sign in to comment.