Package cdc.impex.templates
Class Usage
- java.lang.Object
-
- cdc.impex.templates.Usage
-
public final class Usage extends Object
Definition of possible usage of a columns in a template.This usage is meaningful for imports.
- Author:
- Damien Carbonne
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUsage.Builder
-
Field Summary
Fields Modifier and Type Field Description static UsageACTIONUsage dedicated to the action column.static UsageDERIVED_RO_ATTThe column is a read-only derived (computed) entity attribute.static UsageMANDATORY_RO_ATTThe column is a mandatory read-only entity attribute.static UsageMANDATORY_RO_IDThe column is a mandatory read-only part of the entity id.static UsageMANDATORY_RW_ATTThe column is a mandatory read-write entity attribute.static UsageOPTIONAL_RO_ATTThe column is a optional read-only entity attribute.static UsageOPTIONAL_RO_IDThe column is an optional read-only part of the entity id.static UsageOPTIONAL_RW_ATTThe column is a optional read-write entity attribute.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Usage.Builderbuilder()intgetCount(Presence presence)ImportAction[]getImportActions(Presence presence)StringgetName()PresencegetPresence(ImportAction action)booleanisErasable()booleanisIgnoredFor(ImportAction action)booleanisMandatoryFor(ImportAction action)booleanisMandatoryForFutureImport()booleanisOptionalFor(ImportAction action)StringtoString()
-
-
-
Field Detail
-
ACTION
public static final Usage ACTION
Usage dedicated to the action column.- CREATE:
Presence.OPTIONAL - UPDATE:
Presence.OPTIONAL, can not be erased - DELETE:
Presence.OPTIONAL
- CREATE:
-
MANDATORY_RO_ID
public static final Usage MANDATORY_RO_ID
The column is a mandatory read-only part of the entity id.- CREATE:
Presence.MANDATORY - UPDATE:
Presence.MANDATORY, can not be erased - DELETE:
Presence.MANDATORY
- CREATE:
-
OPTIONAL_RO_ID
public static final Usage OPTIONAL_RO_ID
The column is an optional read-only part of the entity id.- CREATE:
Presence.OPTIONAL - UPDATE:
Presence.OPTIONAL, can not be erased - DELETE:
Presence.OPTIONAL
- CREATE:
-
MANDATORY_RO_ATT
public static final Usage MANDATORY_RO_ATT
The column is a mandatory read-only entity attribute.- CREATE:
Presence.MANDATORY - UPDATE:
Presence.IGNORED, can not be erased - DELETE:
Presence.IGNORED
It can not be changed. - CREATE:
-
OPTIONAL_RO_ATT
public static final Usage OPTIONAL_RO_ATT
The column is a optional read-only entity attribute.- CREATE:
Presence.OPTIONAL - UPDATE:
Presence.IGNORED, can not be erased - DELETE:
Presence.IGNORED
It can not be changed. - CREATE:
-
MANDATORY_RW_ATT
public static final Usage MANDATORY_RW_ATT
The column is a mandatory read-write entity attribute.- CREATE:
Presence.MANDATORY - UPDATE:
Presence.OPTIONAL, can not be erased - DELETE:
Presence.IGNORED
null.
It must be set at creation time.
It can be changed. - CREATE:
-
OPTIONAL_RW_ATT
public static final Usage OPTIONAL_RW_ATT
The column is a optional read-write entity attribute.- CREATE:
Presence.OPTIONAL - UPDATE:
Presence.OPTIONAL, can be erased - DELETE:
Presence.IGNORED
null.
It can be set at creation time.
It can be changed. - CREATE:
-
DERIVED_RO_ATT
public static final Usage DERIVED_RO_ATT
The column is a read-only derived (computed) entity attribute.- CREATE:
Presence.IGNORED - UPDATE:
Presence.IGNORED, can not be erased - DELETE:
Presence.IGNORED
- CREATE:
-
-
Method Detail
-
getName
public String getName()
-
getPresence
public Presence getPresence(ImportAction action)
-
isErasable
public boolean isErasable()
- Returns:
trueif the column can be erased during update.
-
getCount
public int getCount(Presence presence)
-
getImportActions
public ImportAction[] getImportActions(Presence presence)
-
isMandatoryFor
public boolean isMandatoryFor(ImportAction action)
- Parameters:
action- The action.- Returns:
trueif this usage is mandatory foraction.
-
isOptionalFor
public boolean isOptionalFor(ImportAction action)
- Parameters:
action- The action.- Returns:
trueif this usage is optional foraction.
-
isIgnoredFor
public boolean isIgnoredFor(ImportAction action)
- Parameters:
action- The action.- Returns:
trueif this usage is ignored foraction.
-
isMandatoryForFutureImport
public boolean isMandatoryForFutureImport()
- Returns:
trueif this usage is mandatory for a future import.
-
builder
public static Usage.Builder builder()
-
-