Class 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
    • 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
      • 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