Package jetbrains.buildServer.vcs
Class ChangeStatusListBuilder
- java.lang.Object
-
- jetbrains.buildServer.vcs.ChangeStatusListBuilder
-
public class ChangeStatusListBuilder extends java.lang.Object
Object builds aChangeStatus
list from list ofSVcsModification
according to specified settings (e.g. lower and upper bound, size).- Author:
- dmitry.neverov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChangeStatusListBuilder.Id
Unique id of VCS modification.
-
Constructor Summary
Constructors Constructor Description ChangeStatusListBuilder(ChangeStatusProvider changeStatusProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 filtersChangeStatusListBuilder
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 ofChangeStatus
ChangeStatusListBuilder
setSource(java.util.List<SVcsModification> modifications)
Set list ofSVcsModification
from which resulting list ofChangeStatus
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.
-
-
-
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 ofSVcsModification
from which resulting list ofChangeStatus
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
andm2
from the listm1.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 ofChangeStatus
- 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 ifinclusive
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 boundinclusive
- 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 ifinclusive
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 boundinclusive
- 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
-
-