Package com.ibm.di.migration
Class ChangeDescription
- java.lang.Object
-
- com.ibm.di.migration.ChangeDescription
-
public final class ChangeDescription extends java.lang.ObjectThis 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 intTYPE_ADDSpecifies that the property should be added.static intTYPE_COMMENTSpecifies that the property should be commented.static intTYPE_DELETESpecifies that the property should be deleted.static intTYPE_MODIFYSpecifies that the property should be modified.static intTYPE_UNCOMMENTSpecifies 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.StringgetAddAfterKey()java.util.List<java.lang.String>getAddComment()protected intgetAddNewLinesAfter()protected intgetAddNewLinesBefore()java.lang.StringgetPropertyKey()java.lang.StringgetValue()booleanisAdded()Answerstrueif the change type containsTYPE_ADDbooleanisCommented()Answerstrueif the change type containsTYPE_COMMENTbooleanisDeleted()Answerstrueif the change type containsTYPE_DELETEbooleanisDeletingComments()booleanisModifyed()Answerstrueif the change type containsTYPE_MODIFYbooleanisUncommented()Answerstrueif 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 withnullfor 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 ornulladdAfterKey- specifies the name of the key to add this property after. May benulladdCommentLines- 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 benulladdNewLinesBefore- 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 ornulladdAfterKey- 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()
Answerstrueif the change type containsTYPE_ADD- Returns:
trueifTYPE_ADDis present,falseotherwise.
-
isModifyed
public boolean isModifyed()
Answerstrueif the change type containsTYPE_MODIFY- Returns:
trueifTYPE_MODIFYis present,falseotherwise.
-
isDeleted
public boolean isDeleted()
Answerstrueif the change type containsTYPE_DELETE- Returns:
trueifTYPE_DELETEis present,falseotherwise.
-
isCommented
public boolean isCommented()
Answerstrueif the change type containsTYPE_COMMENT- Returns:
trueifTYPE_COMMENTis present,falseotherwise.
-
isUncommented
public boolean isUncommented()
Answerstrueif the change type containsTYPE_UNCOMMENT- Returns:
trueifTYPE_UNCOMMENTis present,falseotherwise.
-
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:
trueif 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.
-
-