Interface StructureRow

All Known Implementing Classes:
DummyRow, ShallowRow, SimpleRow, StructureRow.ZeroRow, SuperRootRow, TransientRow

@PublicApi public interface StructureRow

StructureRow instances represent rows, main building blocks of a forest.

Structures and query results emit forests. Forest content is expressed as a sequence of row IDs. To get more information about the row, you need to get StructureRow instance from RowManager.

A row has the following properties:

  • rowID is the unique ID of the row.
  • itemID is the ID of the item that is displayed in this row.
  • semantics is the semantic code of the relationship between the row and its parent. Currently, semantics are not supported and are zero most of the times.
  • originalId and creatorId are additional properties, specified only for transient rows — see RowManager.

Note that a single forest may contain the same item in multiple places, but all rows will be unique.

Rows are immutable. Persistent rows get stored in the database and are never updated nor deleted. Temporary rows get cleared when JIRA instance restarts. Garbage collection for rows is planned for the future.

Important: StructureRow is a temporary object and must not be cached or leaked outside the current request, because it stores the result of access check to the item for the current user.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final StructureRow
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <I> I
    getItem(Class<I> itemClass)
    Tries to resolve the item based on its ID, that is, get an object that represents this item.
    Returns item ID for the item shown in this row.
    long
    Returns row ID, a positive number.
    long
    Returns row's semantics.
  • Field Details

  • Method Details

    • getRowId

      long getRowId()
      Returns row ID, a positive number.
    • getItemId

      @NotNull ItemIdentity getItemId()
      Returns item ID for the item shown in this row.
    • getSemantics

      long getSemantics()
      Returns row's semantics.
    • getItem

      @Nullable <I> I getItem(@NotNull Class<I> itemClass)

      Tries to resolve the item based on its ID, that is, get an object that represents this item. Resolution includes checking the current user's access to that item, unless the row is created with an additional flag indicating that the access check should be skipped.

      This method may return null in many different cases:

      • The item does not exist.
      • The item is not accessible by the current user.
      • The instance of StructureRow was created with the ItemAccessMode.ITEM_NOT_NEEDED flag.
      • The plugin module that is responsible for this type of items is disabled or missing.
      • Item's object type is not reducible to itemClass.
      Type Parameters:
      I - type of item's objects
      Parameters:
      itemClass - expected class of the item's object
      Returns:
      the item's object, or null