Package cdc.impex.templates
Enum Usage
- java.lang.Object
-
- java.lang.Enum<Usage>
-
- cdc.impex.templates.Usage
-
- All Implemented Interfaces:
Serializable,Comparable<Usage>
public enum Usage extends Enum<Usage>
Enumeration of possible usages for columns in a template.This usage is meaningful for imports.
- Author:
- Damien Carbonne
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DERIVEDThe column is optional and can not be set manually.MANDATORYThe column is mandatory whatever the action is.MANDATORY_ON_CREATEThe column is mandatory if the action isImportAction.CREATE.OPTIONALThe column is optional whatever the action is.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisMandatoryFor(ImportAction action)Returnstrueif this usage is mandatory for anaction.booleanisMandatoryForFutureImport()static UsagevalueOf(String name)Returns the enum constant of this type with the specified name.static Usage[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
OPTIONAL
public static final Usage OPTIONAL
The column is optional whatever the action is.
-
DERIVED
public static final Usage DERIVED
The column is optional and can not be set manually.It is optional, and only informative in exports
It is useless for imports, but may be present in exports.
It is typically derived or auto generated data.WARNING: it is the Importer responsibility to always ignore this column.
-
MANDATORY
public static final Usage MANDATORY
The column is mandatory whatever the action is.This is typically the case of Action column or identifier columns.
-
MANDATORY_ON_CREATE
public static final Usage MANDATORY_ON_CREATE
The column is mandatory if the action isImportAction.CREATE.This is typically the case of read-only attributes, that must be set at creation time.
-
-
Method Detail
-
values
public static Usage[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Usage c : Usage.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Usage valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
isMandatoryFor
public boolean isMandatoryFor(ImportAction action)
Returnstrueif this usage is mandatory for anaction.- Parameters:
action- The action.- Returns:
trueif this usage mandatory foraction.
-
isMandatoryForFutureImport
public boolean isMandatoryForFutureImport()
- Returns:
trueif this usage is mandatory for a future import.
-
-