All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.almworks.jira.structure.api2g.attribute.AttributeTrail Maven / Gradle / Ivy

There is a newer version: 17.25.3
Show newest version
package com.almworks.jira.structure.api2g.attribute;

import com.almworks.jira.structure.api2g.attribute.loader.ForestDependencyType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collections;
import java.util.Set;

public interface AttributeTrail {
  AttributeTrail EMPTY = new EmptyTrail();

  @NotNull
  Set getTrailMode();

  @Nullable
  ItemSet getAdditionalItemDependencies(Long row);

  /**
   * @return true if the value for the row can be reliably cached and invalidated, by observing forest changes (according to trail mode),
   * and item changes (according to row's item and additional dependencies). {@code false} is returned only when the row
   * has been mapped to another row, and so correct invalidation according to forest updates is impossible
   */
  boolean isCacheable(Long row);


  class EmptyTrail implements AttributeTrail {
    @NotNull
    @Override
    public Set getTrailMode() {
      return Collections.emptySet();
    }

    @Nullable
    @Override
    public ItemSet getAdditionalItemDependencies(Long row) {
      return null;
    }

    @Override
    public boolean isCacheable(Long row) {
      return false;
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy