public class CsvAsset extends AbstractAsset
Asset available in the CSV format.| Modifier and Type | Field and Description |
|---|---|
static char |
defaultDelimiter |
static String |
defaultEncoding |
static boolean |
defaultHeader |
static char |
defaultQuote |
static long |
defaultRows |
static Type<CsvAsset> |
type
The generic type of
CsvAssets. |
| Modifier | Constructor and Description |
|---|---|
|
CsvAsset(String name,
RepositoryService service,
Property... properties)
Creates an instance with a given name, target service, and properties.
|
|
CsvAsset(String id,
String name,
Property... properties)
Creates an instance with a given identifier, name, and properties.
|
|
CsvAsset(String name,
String id,
RepositoryService service,
Property... properties)
Creates an instance with a given identifier, name, target service, and properties.
|
protected |
CsvAsset(Type<T> type,
String name,
RepositoryService service,
Property... properties)
Creates an instance with a given type, name, target service, and properties.
|
protected |
CsvAsset(Type<T> type,
String id,
String name,
Property... properties)
Creates an instance with a given type, identifier, name, and properties.
|
protected |
CsvAsset(Type<T> type,
String id,
String name,
RepositoryService service,
Property... properties)
Creates an instance with a given type, identifier, name, target service, and properties.
|
| Modifier and Type | Method and Description |
|---|---|
List<Column> |
columns()
Returns the columns of this asset.
|
char |
delimiter()
Returns the delimiter character used in the content of this asset (by default a comma,
,). |
Charset |
encoding()
Returns the encoding of the content of this asset (by default
UTF-8). |
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
hasHeader()
Indicates whether the content of this asset has a header row (by default
false). |
void |
hasHeader(boolean header)
Indicates whether the content of this asset has a header row, overriding the default (
false). |
char |
quote()
Returns the quote character used in the content of this asset (by default a quotation mark,
"). |
Long |
rows()
Returns the number of rows in the content of this asset.
|
void |
setColumns(Column... columns)
Sets the columns of this asset.
|
void |
setDelimiter(char delimiter)
Sets the delimiter character used in the content of this asset, overwriting the default (a comma,
,). |
void |
setEncoding(Charset encoding)
Sets the encoding of the content of this asset, overriding the default (
UTF-8). |
void |
setQuote(char quote)
Sets the quote character used in the content of this asset, overriding the default (a quotation mark,
"). |
void |
setRows(long rows)
Sets the number of rows in the content of this asset.
|
String |
toString() |
id, name, service, setService, setVersion, type, versionproperties, propertiesclone, finalize, getClass, notify, notifyAll, wait, wait, waitpropertiespublic static final char defaultDelimiter
public static final char defaultQuote
public static final String defaultEncoding
public static final boolean defaultHeader
public static final long defaultRows
protected CsvAsset(Type<T> type, String id, String name, Property... properties)
Inherit as a plugin-facing constructor for asset discovery and retrieval purposes.
type - the typeid - the identifiername - the nameproperties - the propertiespublic CsvAsset(String id, String name, Property... properties)
A plugin-facing constructor for asset discovery and retrieval.
id - the identifiername - the nameproperties - the propertiesprotected CsvAsset(Type<T> type, String id, String name, RepositoryService service, Property... properties)
Inherit as a client-facing constructor for asset publication with services that allow client-defined identifiers.
type - the typeid - the identifiername - the nameservice - the target serviceproperties - the propertiesprotected CsvAsset(Type<T> type, String name, RepositoryService service, Property... properties)
Inherit as a client-facing constructor for asset publication with services that do now allow client-defined identifiers, or else that force services to generate identifiers.
type - the typename - the nameservice - the target serviceproperties - the propertiespublic CsvAsset(String name, RepositoryService service, Property... properties)
Use for asset publication with services that do now allow client-defined identifiers, or else that force services to generate identifiers.
name - the nameservice - the target serviceproperties - the propertiespublic CsvAsset(String name, String id, RepositoryService service, Property... properties)
Use for asset publication with services that allow client-defined identifiers.
id - the identifiername - the nameservice - the target serviceproperties - the propertiespublic char delimiter()
,).public void setDelimiter(char delimiter)
,).delimiter - the delimiter characterpublic char quote()
").public void setQuote(char quote)
").quote - the quote characterpublic boolean hasHeader()
false).true if the content of this asset has a header rowpublic void hasHeader(boolean header)
false).header - true if the content of this asset has a header rowpublic Charset encoding()
UTF-8).public void setEncoding(Charset encoding)
UTF-8).encoding - the encodingpublic List<Column> columns()
public void setRows(long rows)
rows - the number of rowspublic Long rows()
public void setColumns(Column... columns)
cols - the columnspublic String toString()
toString in class AbstractAssetpublic int hashCode()
hashCode in class AbstractAssetpublic boolean equals(Object obj)
equals in class AbstractAssetCopyright © 2018. All rights reserved.