Class PositionConstraint


  • public abstract class PositionConstraint
    extends Object
    Fixed set of objects describing ordering constraints. A generalization of jetbrains.buildServer.web.openapi.PositionConstraint
    Since:
    6.0
    • Constructor Detail

      • PositionConstraint

        public PositionConstraint()
    • Method Detail

      • first

        @NotNull
        public static PositionConstraint first()
        Indicates that the item must be the first.
        Returns:
        new constraint
      • last

        @NotNull
        public static PositionConstraint last()
        Indicates that item must be the last.
        Returns:
        new constraint
      • isFirst

        public boolean isFirst()
        Returns:
        true if isFirst
        Since:
        7.0
      • isLast

        public boolean isLast()
        Returns:
        true is IsLast
        Since:
        7.0
      • getBefore

        @NotNull
        public Collection<String> getBefore()
        Returns:
        id of items before
        Since:
        7.0
      • getAfter

        @NotNull
        public Collection<String> getAfter()
        Returns:
        id of items after
        Since:
        7.0
      • before

        @NotNull
        public static PositionConstraint before​(@NotNull
                                                String... ids)
        Indicates that item must be placed before other items with specified identifiers
        Parameters:
        ids - items identifiers
        Returns:
        new constraint
      • after

        @NotNull
        public static PositionConstraint after​(@NotNull
                                               String... ids)
        Indicates that item must be placed after other items with specified identifiers
        Parameters:
        ids - items identifiers
        Returns:
        new constraint
      • between

        @NotNull
        public static PositionConstraint between​(@NotNull
                                                 Collection<String> afterIds,
                                                 @NotNull
                                                 Collection<String> beforeIds)
        Indicates that item must be placed between other items.
        Parameters:
        afterIds - the item will be placed after the items with provided ids
        beforeIds - the item will be placed before the items with provided ids
        Returns:
        new constraint
      • toString

        public abstract String toString()
        Human-readable presentation of the constraint.
        Overrides:
        toString in class Object
        Returns:
        see above
      • compareTo

        public abstract int compareTo​(String id)
        "Compares" current PositionConstraint to id. Returns a negative integer, zero, or a positive integer as item with "id" should be before, after or should not change its position based on the current constraint.
        Parameters:
        id - id of the item to compare item with current constraint to
        Returns:
        a negative integer if the "id"-specified item should be placed before the item with current constraint, or a positive integer if the "id"-specified item should be placed after the item with current constraint, or zero if the "id"-specified item is not comparable with the item having current constraint.