jetbrains.buildServer.vcs
Class VcsChange

java.lang.Object
  extended by jetbrains.buildServer.vcs.VcsChange
All Implemented Interfaces:
VcsChangeInfo
Direct Known Subclasses:
FilteredVcsChange

public class VcsChange
extends java.lang.Object
implements VcsChangeInfo

Presents change of one file on the modification


Nested Class Summary
 
Nested classes/interfaces inherited from interface jetbrains.buildServer.vcs.VcsChangeInfo
VcsChangeInfo.ContentType, VcsChangeInfo.Type
 
Constructor Summary
  VcsChange(VcsChangeInfo.Type type, java.lang.String fileName, java.lang.String relativeFileName, java.lang.String beforeNum, java.lang.String afterNum)
          Creates new VcsChange instance with default change name.
  VcsChange(VcsChangeInfo.Type type, java.lang.String changeName, java.lang.String fileName, java.lang.String relativeFileName, java.lang.String beforeNum, java.lang.String afterNum)
          Creates new VcsChange instance.
protected VcsChange(VcsChangeInfo source)
           
 
Method Summary
static java.util.List<VcsChange> createList(java.util.Collection<? extends VcsChangeInfo> source)
          Converts list of change info to the corresponding changes
 boolean equals(java.lang.Object o)
           
static VcsChange forTest()
           
 java.lang.String getAfterChangeRevisionNumber()
          Revision number of the file after the change.
 java.lang.String getBeforeChangeRevisionNumber()
          Revision number of the file before the change.
 java.lang.String getChangeTypeName()
           
 java.lang.String getFileName()
           
 java.lang.String getRelativeFileName()
          Returns the relative name of this file.
 VcsChangeInfo.Type getType()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VcsChange

public VcsChange(@NotNull
                 VcsChangeInfo.Type type,
                 @Nullable
                 java.lang.String changeName,
                 @NotNull
                 java.lang.String fileName,
                 @NotNull
                 java.lang.String relativeFileName,
                 @Nullable
                 java.lang.String beforeNum,
                 @Nullable
                 java.lang.String afterNum)
Creates new VcsChange instance.

Parameters:
type - change type. Can be one of 4 kinds. Based on this type files in change are shown in corresponding colour.
changeName - string representation of the change kind. Should be in human readable format. If the value is null description from the type will be used.
fileName - VcsSupport has to be able to deal with this path, return file content by specified VcsChange.
relativeFileName - string representation of the file in repository. Should be 1) relative to VcsRoot and 2) human readable.
beforeNum - file revision before the change. Can be repository version before change.
afterNum - file revision after the change. Can be repository version after change.

VcsChange

public VcsChange(@NotNull
                 VcsChangeInfo.Type type,
                 @NotNull
                 java.lang.String fileName,
                 @NotNull
                 java.lang.String relativeFileName,
                 @Nullable
                 java.lang.String beforeNum,
                 @Nullable
                 java.lang.String afterNum)
Creates new VcsChange instance with default change name.

Parameters:
type - change type. Can be one of 4 kinds. Based on this type files in change are shown in corresponding colour.
fileName - VcsSupport has to be able to deal with this path, return file content by specified VcsChange.
relativeFileName - string representation of the file in repository. Should be 1) relative to VcsRoot and 2) human readable.
beforeNum - file revision before the change. Can be repository version before change.
afterNum - file revision after the change. Can be repository version after change.

VcsChange

protected VcsChange(@NotNull
                    VcsChangeInfo source)
Method Detail

createList

public static java.util.List<VcsChange> createList(@Nullable
                                                   java.util.Collection<? extends VcsChangeInfo> source)
Converts list of change info to the corresponding changes

Parameters:
source - list to convert
Returns:
list of change info instances

forTest

public static VcsChange forTest()
Returns:
test change instance, not for production usage

getChangeTypeName

@Nullable
public java.lang.String getChangeTypeName()
Specified by:
getChangeTypeName in interface VcsChangeInfo
Returns:
human readable change type name

getFileName

@NotNull
public java.lang.String getFileName()
Specified by:
getFileName in interface VcsChangeInfo
Returns:
whole file name

getRelativeFileName

@NotNull
public java.lang.String getRelativeFileName()
Description copied from interface: VcsChangeInfo
Returns the relative name of this file. Note: the result path can be be mapped (i.e. takes into account checkout rules) or not depending on how this object has been acquired.

Specified by:
getRelativeFileName in interface VcsChangeInfo
Returns:
relative to vcs root file name

getType

@NotNull
public VcsChangeInfo.Type getType()
Specified by:
getType in interface VcsChangeInfo
Returns:
change type

getBeforeChangeRevisionNumber

@Nullable
public java.lang.String getBeforeChangeRevisionNumber()
Description copied from interface: VcsChangeInfo
Revision number of the file before the change. This revision may or may not be the same as version returned by VcsSupportCore.getCurrentVersion(VcsRoot) method. This revision is shown in the web UI only and it should have some meaningful value for users. Also this revision may help VCS plugin to obtain file content, see VcsFileContentProvider

Specified by:
getBeforeChangeRevisionNumber in interface VcsChangeInfo
Returns:
revision number before the change

getAfterChangeRevisionNumber

@Nullable
public java.lang.String getAfterChangeRevisionNumber()
Description copied from interface: VcsChangeInfo
Revision number of the file after the change. See also VcsChangeInfo.getBeforeChangeRevisionNumber().

Specified by:
getAfterChangeRevisionNumber in interface VcsChangeInfo
Returns:
revision number after the change

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object