jetbrains.buildServer.vcs
Class ChangeStatusListBuilder

java.lang.Object
  extended by jetbrains.buildServer.vcs.ChangeStatusListBuilder

public class ChangeStatusListBuilder
extends java.lang.Object

Object builds a ChangeStatus list from list of SVcsModification according to specified settings (e.g. lower and upper bound, size).

Author:
dmitry.neverov

Nested Class Summary
static class ChangeStatusListBuilder.Id
          Unique id of VCS modification.
 
Constructor Summary
ChangeStatusListBuilder(ChangeStatusProvider changeStatusProvider)
           
 
Method Summary
 ChangeStatusListBuilder addFilter(BuildTypeFilter buildTypeFilter)
          Add a BuildType filter.
 ChangeStatusListBuilder addFilter(Filter<SVcsModification> filter)
          Add a VCS modification filter.
 java.util.List<ChangeStatus> build()
          Returns ChangeStatus list according to specified settings.
 ChangeStatusListBuilder clearFilters()
          Clear VCS modification filters
 ChangeStatusListBuilder setLowerBound(ChangeStatusListBuilder.Id id)
          Set the lower bound id in VCS modification list.
 ChangeStatusListBuilder setLowerBound(ChangeStatusListBuilder.Id id, boolean inclusive)
          Set the lower bound id in VCS modification list.
 ChangeStatusListBuilder setSize(int size)
          Set size of resulting list of ChangeStatus
 ChangeStatusListBuilder setSource(java.util.List<SVcsModification> modifications)
          Set list of SVcsModification from which resulting list of ChangeStatus will be built.
 ChangeStatusListBuilder setUpperBound(ChangeStatusListBuilder.Id id)
          Set the upper bound id in VCS modification list.
 ChangeStatusListBuilder setUpperBound(ChangeStatusListBuilder.Id id, boolean inclusive)
          Set the upper bound id in VCS modification list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeStatusListBuilder

public ChangeStatusListBuilder(@NotNull
                               ChangeStatusProvider changeStatusProvider)
Method Detail

build

@NotNull
public java.util.List<ChangeStatus> build()
Returns ChangeStatus list according to specified settings.

Returns:
see above

setSource

public ChangeStatusListBuilder setSource(java.util.List<SVcsModification> modifications)
Set list of SVcsModification from which resulting list of ChangeStatus will be built.

List of VCS modifications must be sorted by modification id and must contain unique modifications only (i.e. for any two modifications m1 and m2 from the list m1.getId() != m2.getId()). These conditions should be checked by a caller.

Parameters:
modifications - see above
Returns:
builder itself

setSize

public ChangeStatusListBuilder setSize(int size)
Set size of resulting list of ChangeStatus

Parameters:
size - see above
Returns:
builder itself

setLowerBound

public ChangeStatusListBuilder setLowerBound(ChangeStatusListBuilder.Id id)
Set the lower bound id in VCS modification list. All VCS modifications placed before specified lower bound and their duplicates will not be included in the resulting list. ChangeStatus of the lower bound modification will not be included either.

Parameters:
id - id of the lower bound
Returns:
builder itself

setLowerBound

public ChangeStatusListBuilder setLowerBound(ChangeStatusListBuilder.Id id,
                                             boolean inclusive)
Set the lower bound id in VCS modification list. All VCS modifications placed before specified lower bound and their duplicates will not be included in the resulting list. ChangeStatus of the lower bound modification will be included if inclusive is set to true and lower bound modification is not duplicate of some earlier modification in the source list.

Parameters:
id - id of the lower bound
inclusive - flag to include the lower bound
Returns:
builder itself

setUpperBound

public ChangeStatusListBuilder setUpperBound(ChangeStatusListBuilder.Id id)
Set the upper bound id in VCS modification list. All VCS modifications placed after specified upper bound will not be included in resulting list. ChangeStatus of the upper bound modification will not be included either.

Parameters:
id - id of the upper bound
Returns:
builder itself

setUpperBound

public ChangeStatusListBuilder setUpperBound(ChangeStatusListBuilder.Id id,
                                             boolean inclusive)
Set the upper bound id in VCS modification list. All VCS modifications placed after specified upper bound will not be included in resulting list. ChangeStatus of the upper bound modification will be included if inclusive is set to true and upper bound modification is not duplicate of some earlier modification in the source list.

Parameters:
id - id of the upper bound
inclusive - flag to include the upper bound
Returns:
builder itself

addFilter

public ChangeStatusListBuilder addFilter(Filter<SVcsModification> filter)
Add a VCS modification filter. Resulting list will contain only ChangeStatuses created from VCS modifications accepted by added filters.

Parameters:
filter - VCS modification filter
Returns:
builder itself

addFilter

public ChangeStatusListBuilder addFilter(BuildTypeFilter buildTypeFilter)
Add a BuildType filter. Resulting list will contain only ChangeStatuses created from VCS modifications related to buildTypes accepted by this filter.

Parameters:
buildTypeFilter - BuildType filter
Returns:
builder itself

clearFilters

public ChangeStatusListBuilder clearFilters()
Clear VCS modification filters

Returns:
builder itself