Package com.ibm.di.migration
Class ChangeDescription
- java.lang.Object
-
- com.ibm.di.migration.ChangeDescription
-
public final class ChangeDescription extends java.lang.Object
This class is used to describe the changes that need to be performed over a particular property.- Since:
- TDI 7.1
-
-
Field Summary
Fields Modifier and Type Field Description static int
TYPE_ADD
Specifies that the property should be added.static int
TYPE_COMMENT
Specifies that the property should be commented.static int
TYPE_DELETE
Specifies that the property should be deleted.static int
TYPE_MODIFY
Specifies that the property should be modified.static int
TYPE_UNCOMMENT
Specifies that the property should be uncommented.
-
Constructor Summary
Constructors Constructor Description ChangeDescription(java.lang.String propertyKey, int type)
Constructs an instance by providing the type of change only.ChangeDescription(java.lang.String propertyKey, int type, boolean deleteCommentsBefore)
Constructs an instance by providing the type of change.ChangeDescription(java.lang.String propertyKey, int type, java.lang.String value)
Constructs an instance by providing the type of change.ChangeDescription(java.lang.String propertyKey, int type, java.lang.String value, java.lang.String addAfterKey)
Constructs an instance by providing the type of change.ChangeDescription(java.lang.String propertyKey, int type, java.lang.String value, java.lang.String addAfterKey, java.lang.String[] addCommentLines, int addNewLinesBefore, int addNewLinesAfter)
Constructs an instance by providing the type of change.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAddAfterKey()
java.util.List<java.lang.String>
getAddComment()
protected int
getAddNewLinesAfter()
protected int
getAddNewLinesBefore()
java.lang.String
getPropertyKey()
java.lang.String
getValue()
boolean
isAdded()
Answerstrue
if the change type containsTYPE_ADD
boolean
isCommented()
Answerstrue
if the change type containsTYPE_COMMENT
boolean
isDeleted()
Answerstrue
if the change type containsTYPE_DELETE
boolean
isDeletingComments()
boolean
isModifyed()
Answerstrue
if the change type containsTYPE_MODIFY
boolean
isUncommented()
Answerstrue
if the change type containsTYPE_UNCOMMENT
-
-
-
Field Detail
-
TYPE_COMMENT
public static final int TYPE_COMMENT
Specifies that the property should be commented.- See Also:
- Constant Field Values
-
TYPE_UNCOMMENT
public static final int TYPE_UNCOMMENT
Specifies that the property should be uncommented.- See Also:
- Constant Field Values
-
TYPE_ADD
public static final int TYPE_ADD
Specifies that the property should be added.- See Also:
- Constant Field Values
-
TYPE_MODIFY
public static final int TYPE_MODIFY
Specifies that the property should be modified.- See Also:
- Constant Field Values
-
TYPE_DELETE
public static final int TYPE_DELETE
Specifies that the property should be deleted.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ChangeDescription
public ChangeDescription(java.lang.String propertyKey, int type)
Constructs an instance by providing the type of change only. This is useful for changes that don't need value operand -TYPE_COMMENT
,TYPE_UNCOMMENT
,TYPE_DELETE
.- Parameters:
type
- the type of change to create. The changes could be logically OR'd to build a complex type of change.
-
ChangeDescription
public ChangeDescription(java.lang.String propertyKey, int type, java.lang.String value)
Constructs an instance by providing the type of change. This is useful for changes that don't need any other operands but a value -TYPE_ADD
,TYPE_MODIFY
. It could also be used withnull
for the following changes -TYPE_COMMENT
,TYPE_UNCOMMENT
,TYPE_DELETE
- Parameters:
type
- the type of change to create. The changes could be logically OR'd to build a complex type of change.value
- the value of the added/modified property ornull
-
ChangeDescription
public ChangeDescription(java.lang.String propertyKey, int type, java.lang.String value, java.lang.String addAfterKey)
Constructs an instance by providing the type of change. This is useful for changes describing addition of a property -TYPE_ADD
. It could also be used with nullified values for the following changes -TYPE_COMMENT
,TYPE_UNCOMMENT
,TYPE_DELETE
,TYPE_MODIFY
- Parameters:
type
- the type of change to create. The changes could be logically OR'd to build a complex type of change.value
- the value of the added/modified property ornull
addAfterKey
- specifies the name of the key to add this property after. May benull
addCommentLines
- specifies an array of lines of comments to add before this property. Each string will be commented and put on a separate line in the output configuration file. May benull
addNewLinesBefore
- specifies the number of lines to add before the property (or the comments if there are some)addNewLinesAfter
- specifies the number of lines to add after the property
-
ChangeDescription
public ChangeDescription(java.lang.String propertyKey, int type, java.lang.String value, java.lang.String addAfterKey, java.lang.String[] addCommentLines, int addNewLinesBefore, int addNewLinesAfter)
Constructs an instance by providing the type of change. This is useful for changes describing addition of a property -TYPE_ADD
. It could also be used with nullified values for the following changes -TYPE_COMMENT
,TYPE_UNCOMMENT
,TYPE_DELETE
,TYPE_MODIFY
- Parameters:
type
- the type of change to create. The changes could be logically OR'd to build a complex type of change.value
- the value of the added/modified property ornull
addAfterKey
- specifies the name of the key to add this property after. May benull
-
ChangeDescription
public ChangeDescription(java.lang.String propertyKey, int type, boolean deleteCommentsBefore)
Constructs an instance by providing the type of change. This is useful for changes describing deletion of a property -TYPE_DELETE
.- Parameters:
type
- the type of change to create. The changes could be logically OR'd to build a complex type of change.deleteCommentsBefore
- specifies whether the comments right before the property should be deleted.
-
-
Method Detail
-
getPropertyKey
public java.lang.String getPropertyKey()
- Returns:
- the key name of the property that will be changed.
-
isAdded
public boolean isAdded()
Answerstrue
if the change type containsTYPE_ADD
- Returns:
true
ifTYPE_ADD
is present,false
otherwise.
-
isModifyed
public boolean isModifyed()
Answerstrue
if the change type containsTYPE_MODIFY
- Returns:
true
ifTYPE_MODIFY
is present,false
otherwise.
-
isDeleted
public boolean isDeleted()
Answerstrue
if the change type containsTYPE_DELETE
- Returns:
true
ifTYPE_DELETE
is present,false
otherwise.
-
isCommented
public boolean isCommented()
Answerstrue
if the change type containsTYPE_COMMENT
- Returns:
true
ifTYPE_COMMENT
is present,false
otherwise.
-
isUncommented
public boolean isUncommented()
Answerstrue
if the change type containsTYPE_UNCOMMENT
- Returns:
true
ifTYPE_UNCOMMENT
is present,false
otherwise.
-
getValue
public java.lang.String getValue()
- Returns:
- the value of the new property to add/modify
-
getAddAfterKey
public java.lang.String getAddAfterKey()
- Returns:
- the key name of the property to add this after
-
isDeletingComments
public boolean isDeletingComments()
- Returns:
true
if the interpreter should delete the comments before this property.
-
getAddComment
public java.util.List<java.lang.String> getAddComment()
- Returns:
- the strings of the block of comments to put before this property.
-
getAddNewLinesBefore
protected int getAddNewLinesBefore()
- Returns:
- the number of End-Of-Lines characters to put before this property.
-
getAddNewLinesAfter
protected int getAddNewLinesAfter()
- Returns:
- the number of End-Of-Lines characters to put after this property.
-
-