org.locationtech.geogig.model.Ref.isChild()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中org.locationtech.geogig.model.Ref.isChild方法的一些代码示例,展示了Ref.isChild的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ref.isChild方法的具体详情如下:
包路径:org.locationtech.geogig.model.Ref
类名称:Ref
方法名:isChild

Ref.isChild介绍

[英]Determines if the ref is a child of parent
[中]确定ref是否是父对象的子对象

代码示例

代码示例来源:origin: locationtech/geogig

@Override
public boolean apply(Ref r) {
  return Ref.isChild(remotePrefix, r.getName());
}};

代码示例来源:origin: locationtech/geogig

public Optional<String> mapToRemote(final String local) {
  Preconditions.checkNotNull(local);
  String remoteRef = null;
  if (isAllChildren()) {
    if (Ref.isChild(this.localRef, local)) {
      final String localRefName = local.substring(this.localRef.length());
      remoteRef = Ref.append(this.remoteRef, localRefName);
    }
  } else {
    if (local.equals(this.localRef)) {
      remoteRef = this.remoteRef;
    }
  }
  return Optional.ofNullable(remoteRef);
}

代码示例来源:origin: locationtech/geogig

public Optional<String> mapToLocal(final String remoteRef) {
  Preconditions.checkNotNull(remoteRef);
  String localRef = null;
  if (isAllChildren()) {
    if (Ref.isChild(this.remoteRef, remoteRef)) {
      final String remoteRefName = remoteRef.substring(this.remoteRef.length());
      localRef = Ref.append(this.localRef, remoteRefName);
    }
  } else {
    if (remoteRef.equals(this.remoteRef)) {
      localRef = this.localRef;
    }
  }
  return Optional.ofNullable(localRef);
}

代码示例来源:origin: locationtech/geogig

protected Ref _call() {
  checkState(branchName != null, "branch name was not provided");
  final String branchRefPath;
  if (Ref.isChild(Ref.HEADS_PREFIX, branchName)) {
    branchRefPath = branchName;
  } else {

相关文章