Package com.google.gerrit.reviewdb.client

Examples of com.google.gerrit.reviewdb.client.Change


    return new Project.NameKey(getValue());
  }

  @Override
  public boolean match(final ChangeData object) throws OrmException {
    Change change = object.change(dbProvider);
    if (change == null) {
      return false;
    }

    Project.NameKey p = change.getDest().getParentKey();
    return p.equals(getValueKey());
  }
View Full Code Here


      super(dbProvider, "sortkey_before", value);
    }

    @Override
    public boolean match(ChangeData cd) throws OrmException {
      Change change = cd.change(dbProvider);
      return change != null && change.getSortKey().compareTo(getValue()) < 0;
    }
View Full Code Here

      super(dbProvider, "sortkey_after", value);
    }

    @Override
    public boolean match(ChangeData cd) throws OrmException {
      Change change = cd.change(dbProvider);
      return change != null && change.getSortKey().compareTo(getValue()) > 0;
    }
View Full Code Here

  }

  public String[] currentFilePaths(Provider<ReviewDb> db,
      PatchListCache cache) throws OrmException {
    if (currentFiles == null) {
      Change c = change(db);
      if (c == null) {
        return null;
      }
      PatchSet ps = currentPatchSet(db);
      if (ps == null) {
View Full Code Here

    return change;
  }

  public PatchSet currentPatchSet(Provider<ReviewDb> db) throws OrmException {
    if (currentPatchSet == null) {
      Change c = change(db);
      if (c == null) {
        return null;
      }
      for (PatchSet p : patches(db)) {
        if (p.getId().equals(c.currentPatchSetId())) {
          currentPatchSet = p;
          return p;
        }
      }
    }
View Full Code Here

  }

  public Collection<PatchSetApproval> currentApprovals(Provider<ReviewDb> db)
      throws OrmException {
    if (currentApprovals == null) {
      Change c = change(db);
      if (c == null) {
        currentApprovals = Collections.emptyList();
      } else if (approvals != null) {
        Map<Id, Collection<PatchSetApproval>> map = approvalsMap(db);
        currentApprovals = map.get(c.currentPatchSetId());
        if (currentApprovals == null) {
          currentApprovals = Collections.emptyList();
          map.put(c.currentPatchSetId(), currentApprovals);
        }
      } else {
        currentApprovals = db.get().patchSetApprovals()
            .byPatchSet(c.currentPatchSetId()).toList();
      }
    }
    return currentApprovals;
  }
View Full Code Here

    this.pattern = new RunAutomaton(new RegExp(re).toAutomaton());
  }

  @Override
  public boolean match(final ChangeData object) throws OrmException {
    Change change = object.change(dbProvider);
    if (change == null) {
      return false;
    }
    return change.getDest().get().startsWith(Branch.R_HEADS)
        && pattern.run(change.getDest().getShortName());
  }
View Full Code Here

    this.dbProvider = dbProvider;
  }

  @Override
  public boolean match(final ChangeData object) throws OrmException {
    Change change = object.change(dbProvider);
    if (change == null) {
      return false;
    }
    return getValue().equals(change.getTopic());
  }
View Full Code Here

    this.dbProvider = dbProvider;
  }

  @Override
  public boolean match(final ChangeData object) throws OrmException {
    Change c = object.change(dbProvider);
    if (c == null) {
      return false;
    }

    PatchSet.Id current = c.currentPatchSetId();
    for (PatchSetApproval p : object.approvals(dbProvider)) {
      if (p.getPatchSetId().equals(current) && p.getValue() != 0) {
        return true;
      }
    }
View Full Code Here

    return id.equals(object.getId());
  }

  @Override
  public ResultSet<ChangeData> read() throws OrmException {
    Change c = db.get().changes().get(id);
    if (c != null) {
      return new ListResultSet<ChangeData>( //
          Collections.singletonList(new ChangeData(c)));
    } else {
      return new ListResultSet<ChangeData>(Collections.<ChangeData> emptyList());
View Full Code Here

TOP

Related Classes of com.google.gerrit.reviewdb.client.Change

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.