Class PositionConstraint
- java.lang.Object
-
- jetbrains.buildServer.util.positioning.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
-
-
Field Summary
Fields Modifier and Type Field Description static PositionConstraint
UNDEFINED
-
Constructor Summary
Constructors Constructor Description PositionConstraint()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static PositionConstraint
after(String... ids)
Indicates that item must be placed after other items with specified identifiersstatic PositionConstraint
before(String... ids)
Indicates that item must be placed before other items with specified identifiersstatic PositionConstraint
between(Collection<String> afterIds, Collection<String> beforeIds)
Indicates that item must be placed between other items.abstract int
compareTo(String id)
"Compares" current PositionConstraint to id.static PositionConstraint
first()
Indicates that the item must be the first.Collection<String>
getAfter()
Collection<String>
getBefore()
boolean
isFirst()
boolean
isLast()
static PositionConstraint
last()
Indicates that item must be the last.abstract String
toString()
Human-readable presentation of the constraint.
-
-
-
Field Detail
-
UNDEFINED
public static final PositionConstraint UNDEFINED
-
-
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 idsbeforeIds
- 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.
-
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.
-
-