com.linecorp.centraldogma.internal.Util.requireNonNullElements()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(138)

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

Util.requireNonNullElements介绍

[英]Makes sure the specified values and all its elements are not null.
[中]确保指定的值及其所有元素不为null。

代码示例

代码示例来源:origin: line/centraldogma

private static Set<Pattern> validateHostnamePatterns(@Nullable Iterable<Pattern> hostnamePatterns) {
  if (hostnamePatterns == null) {
    return ImmutableSet.of();
  }
  return ImmutableSet.copyOf(
      requireNonNullElements(hostnamePatterns, "hostnamePatterns"));
}

代码示例来源:origin: line/centraldogma

@JsonCreator
MultipleMirrorConfig(
    @JsonProperty("enabled") @Nullable Boolean enabled,
    @JsonProperty("defaultSchedule") @Nullable String defaultSchedule,
    @JsonProperty(value = "defaultDirection", required = true) MirrorDirection defaultDirection,
    @JsonProperty("defaultLocalPath") @Nullable String defaultLocalPath,
    @JsonProperty("defaultCredentialId") @Nullable String defaultCredentialId,
    @JsonProperty(value = "includes", required = true)
    @JsonDeserialize(contentAs = MirrorInclude.class)
    Iterable<MirrorInclude> includes,
    @JsonProperty("excludes") @Nullable
    @JsonDeserialize(contentAs = Pattern.class)
    Iterable<Pattern> excludes) {
  super(firstNonNull(enabled, true));
  this.defaultSchedule = cronParser.parse(firstNonNull(defaultSchedule, DEFAULT_SCHEDULE));
  this.defaultDirection = requireNonNull(defaultDirection, "defaultDirection");
  this.defaultLocalPath = firstNonNull(defaultLocalPath, "/");
  this.defaultCredentialId = defaultCredentialId;
  this.includes = ImmutableList.copyOf(requireNonNullElements(includes, "includes"));
  if (excludes != null) {
    this.excludes = ImmutableList.copyOf(requireNonNullElements(excludes, "excludes"));
  } else {
    this.excludes = Collections.emptyList();
  }
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server

private static Set<Pattern> validateHostnamePatterns(@Nullable Iterable<Pattern> hostnamePatterns) {
  if (hostnamePatterns == null) {
    return ImmutableSet.of();
  }
  return ImmutableSet.copyOf(
      requireNonNullElements(hostnamePatterns, "hostnamePatterns"));
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server-shaded

private static Set<Pattern> validateHostnamePatterns(@Nullable Iterable<Pattern> hostnamePatterns) {
  if (hostnamePatterns == null) {
    return ImmutableSet.of();
  }
  return ImmutableSet.copyOf(
      requireNonNullElements(hostnamePatterns, "hostnamePatterns"));
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server

@JsonCreator
MultipleMirrorConfig(
    @JsonProperty("enabled") @Nullable Boolean enabled,
    @JsonProperty("defaultSchedule") @Nullable String defaultSchedule,
    @JsonProperty(value = "defaultDirection", required = true) MirrorDirection defaultDirection,
    @JsonProperty("defaultLocalPath") @Nullable String defaultLocalPath,
    @JsonProperty("defaultCredentialId") @Nullable String defaultCredentialId,
    @JsonProperty(value = "includes", required = true)
    @JsonDeserialize(contentAs = MirrorInclude.class)
    Iterable<MirrorInclude> includes,
    @JsonProperty("excludes") @Nullable
    @JsonDeserialize(contentAs = Pattern.class)
    Iterable<Pattern> excludes) {
  super(firstNonNull(enabled, true));
  this.defaultSchedule = cronParser.parse(firstNonNull(defaultSchedule, DEFAULT_SCHEDULE));
  this.defaultDirection = requireNonNull(defaultDirection, "defaultDirection");
  this.defaultLocalPath = firstNonNull(defaultLocalPath, "/");
  this.defaultCredentialId = defaultCredentialId;
  this.includes = ImmutableList.copyOf(requireNonNullElements(includes, "includes"));
  if (excludes != null) {
    this.excludes = ImmutableList.copyOf(requireNonNullElements(excludes, "excludes"));
  } else {
    this.excludes = Collections.emptyList();
  }
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server-shaded

@JsonCreator
MultipleMirrorConfig(
    @JsonProperty("enabled") @Nullable Boolean enabled,
    @JsonProperty("defaultSchedule") @Nullable String defaultSchedule,
    @JsonProperty(value = "defaultDirection", required = true) MirrorDirection defaultDirection,
    @JsonProperty("defaultLocalPath") @Nullable String defaultLocalPath,
    @JsonProperty("defaultCredentialId") @Nullable String defaultCredentialId,
    @JsonProperty(value = "includes", required = true)
    @JsonDeserialize(contentAs = MirrorInclude.class)
    Iterable<MirrorInclude> includes,
    @JsonProperty("excludes") @Nullable
    @JsonDeserialize(contentAs = Pattern.class)
    Iterable<Pattern> excludes) {
  super(firstNonNull(enabled, true));
  this.defaultSchedule = cronParser.parse(firstNonNull(defaultSchedule, DEFAULT_SCHEDULE));
  this.defaultDirection = requireNonNull(defaultDirection, "defaultDirection");
  this.defaultLocalPath = firstNonNull(defaultLocalPath, "/");
  this.defaultCredentialId = defaultCredentialId;
  this.includes = ImmutableList.copyOf(requireNonNullElements(includes, "includes"));
  if (excludes != null) {
    this.excludes = ImmutableList.copyOf(requireNonNullElements(excludes, "excludes"));
  } else {
    this.excludes = Collections.emptyList();
  }
}

相关文章