io.fabric8.common.util.Strings.isNotBlank()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(127)

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

Strings.isNotBlank介绍

暂无

代码示例

代码示例来源:origin: io.fabric8/fabric-openshift

private boolean isConfigurationValid(Map<String, String> properties) {
    return properties != null
        && properties.containsKey(SERVER_URL) && Strings.isNotBlank(properties.get(SERVER_URL))
        && properties.containsKey(LOGIN) && Strings.isNotBlank(properties.get(LOGIN))
        && properties.containsKey(PASSWORD) && Strings.isNotBlank(properties.get(PASSWORD));
  }
}

代码示例来源:origin: io.fabric8/common-util

@Override
  public Void apply(String line) {
    if (Strings.isNotBlank(line)) {
      answer.add(line.trim());
    }
    return null;
  }
};

代码示例来源:origin: jboss-fuse/fabric8

@Override
  public Void apply(String line) {
    if (Strings.isNotBlank(line)) {
      answer.add(line.trim());
    }
    return null;
  }
};

代码示例来源:origin: io.fabric8/fabric-openshift

private String relativePath(Container container, Map<String, String> configuration, String propertyName) {
  String value = Maps.stringValue(configuration, propertyName);
  if (Strings.isNotBlank(value)) {
    if (value.startsWith("..") || value.startsWith("/") || value.startsWith(File.separator)) {
      throw new IllegalStateException("Invalid relative path '" + value + "' for property " + propertyName + " for container " + container.getId());
    } else {
      return value;
    }
  }
  return null;
}

代码示例来源:origin: io.fabric8/fabric-kubernetes-api

/**
 * Returns a map indexed by service id of the services
 */
public static Map<String, ServiceSchema> toServiceMap(List<ServiceSchema> services) {
  List<ServiceSchema> list = notNullList(services);
  Map<String, ServiceSchema> answer = new HashMap<>();
  for (ServiceSchema serviceSchema : list) {
    String id = serviceSchema.getId();
    if (Strings.isNotBlank(id)) {
      answer.put(id, serviceSchema);
    }
  }
  return answer;
}

代码示例来源:origin: io.fabric8/fabric-kubernetes-api

/**
 * Returns a map indexed by pod id of the pods
 */
public static Map<String, PodSchema> toPodMap(List<PodSchema> pods) {
  List<PodSchema> list = notNullList(pods);
  Map<String, PodSchema> answer = new HashMap<>();
  for (PodSchema podSchema : list) {
    String id = podSchema.getId();
    if (Strings.isNotBlank(id)) {
      answer.put(id, podSchema);
    }
  }
  return answer;
}

代码示例来源:origin: io.fabric8/fabric-zookeeper

/**
 * Returns the non-null String data for all the children matching the given path pattern
 */
public List<String> matchingDescendantStringData(String pattern) throws Exception {
  List<String> paths = matchingDescendants(pattern);
  List<String> answer = new ArrayList<String>();
  for (String path : paths) {
    String text = getStringData(path);
    if (Strings.isNotBlank(text)) {
      answer.add(text);
    }
  }
  return answer;
}

代码示例来源:origin: io.fabric8/fabric-kubernetes-api

/**
 * Returns a map indexed by replicationController id of the replicationControllers
 */
public static Map<String, ReplicationControllerSchema> toReplicationControllerMap(List<ReplicationControllerSchema> replicationControllers) {
  List<ReplicationControllerSchema> list = notNullList(replicationControllers);
  Map<String, ReplicationControllerSchema> answer = new HashMap<>();
  for (ReplicationControllerSchema replicationControllerSchema : list) {
    String id = replicationControllerSchema.getId();
    if (Strings.isNotBlank(id)) {
      answer.put(id, replicationControllerSchema);
    }
  }
  return answer;
}

代码示例来源:origin: io.fabric8/fabric-openshift

public static Element createAndAppendChild(Element owner, String elementName, int indent, String text) {
  Element answer = createAndAppendChild(owner, elementName, indent);
  if (Strings.isNotBlank(text)) {
    appendText(answer, text);
  }
  return answer;
}

代码示例来源:origin: jboss-fuse/fabric8

public boolean isAliveAndOK() {
  String status = getProvisionStatus();
  return isAlive() && !Strings.isNotBlank(getProvisionException()) && (status == null || status.length() == 0 || status.toLowerCase().startsWith(PROVISION_SUCCESS));
}

代码示例来源:origin: io.fabric8/fabric-rest

@Path("profile/{profileId}")
public ProfileResource version(@PathParam("profileId") String profileId) {
  if (Strings.isNotBlank(profileId) && version != null && version.hasProfile(profileId)) {
    Profile profile = version.getRequiredProfile(profileId);
    if (profile != null) {
      return new ProfileResource(this, profile);
    }
  }
  return null;
}

代码示例来源:origin: jboss-fuse/fabric8

@Path("profile/{profileId}")
public ProfileResource version(@PathParam("profileId") String profileId) {
  if (Strings.isNotBlank(profileId) && version != null && version.hasProfile(profileId)) {
    Profile profile = version.getRequiredProfile(profileId);
    if (profile != null) {
      return new ProfileResource(this, profile);
    }
  }
  return null;
}

代码示例来源:origin: io.fabric8/fabric-rest

/**
 * Returns the profile for the given id on this container
 */
@Path("profile/{profileId}")
public ProfileResource version(@PathParam("profileId") String profileId) {
  if (Strings.isNotBlank(profileId) && container != null) {
    Profile profile = Profiles.profile(container.getProfiles(), profileId);
    if (profile != null) {
      return new ProfileResource(this, profile);
    }
  }
  return null;
}

代码示例来源:origin: jboss-fuse/fabric8

public static String requirementOrDefaultVersion(FabricController restAPI, FabricRequirements requirements) {
  String version = requirements.getVersion();
  if (Strings.isNotBlank(version)) {
    return version;
  } else {
    return restAPI.getDefaultVersion();
  }
}

代码示例来源:origin: jboss-fuse/fabric8

/**
 * Returns the profile for the given id on this container
 */
@Path("profile/{profileId}")
public ProfileResource version(@PathParam("profileId") String profileId) {
  if (Strings.isNotBlank(profileId) && container != null) {
    Profile profile = Profiles.profile(container.getProfiles(), profileId);
    if (profile != null) {
      return new ProfileResource(this, profile);
    }
  }
  return null;
}

代码示例来源:origin: io.fabric8/fabric-commands

@Override
  protected Object doExecute() throws Exception {
    if (Strings.isNotBlank(newAlgorithm)) {
      setData(getCurator(), ZkPath.AUTHENTICATION_CRYPT_ALGORITHM.getPath(), newAlgorithm);
    }
    return null;
  }
}

代码示例来源:origin: io.fabric8/fabric-commands

@Override
  protected Object doExecute() throws Exception {
    if (Strings.isNotBlank(newPassword)) {
      setData(getCurator(), ZkPath.AUTHENTICATION_CRYPT_PASSWORD.getPath(), PasswordEncoder.encode(newPassword));
    }
    return null;
  }
}

代码示例来源:origin: jboss-fuse/fabric8

void bootIfNeeded() throws IOException, InterruptedException {
  BundleContext bundleContext = componentContext.getBundleContext();
  boolean isCreated = checkCreated(bundleContext);
  if (!Strings.isNotBlank(zookeeperUrl) && !isCreated && options.isEnsembleStart()) {
    String connectionUrl = getConnectionUrl(options);
    DataStoreOptions bootOptions = new DataStoreOptions(runtimeId, homeDir, connectionUrl, options);
    runtimeProperties.get().putRuntimeAttribute(DataStoreTemplate.class, new DataStoreBootstrapTemplate(bootOptions));
    createOrUpdateDataStoreConfig(options);
    createZooKeeeperServerConfig(componentContext.getBundleContext(), options);
    createZooKeeeperClientConfig(componentContext.getBundleContext(), connectionUrl, options);
    // On restart, the configuration should be available in configadmin
    markCreated(bundleContext);
  }
}

代码示例来源:origin: io.fabric8/fabric-zookeeper

void bootIfNeeded() throws IOException {
  BundleContext bundleContext = componentContext.getBundleContext();
  boolean isCreated = checkCreated(bundleContext);
  if (!Strings.isNotBlank(zookeeperUrl) && !isCreated && options.isEnsembleStart()) {
    String connectionUrl = getConnectionUrl(options);
    DataStoreOptions bootOptions = new DataStoreOptions(runtimeId, homeDir, connectionUrl, options);
    runtimeProperties.get().putRuntimeAttribute(DataStoreTemplate.class, new DataStoreBootstrapTemplate(bootOptions));
    createOrUpdateDataStoreConfig(options);
    createZooKeeeperServerConfig(options);
    createZooKeeeperClientConfig(connectionUrl, options);
    // On restart, the configuration should be available in configadmin
    markCreated(bundleContext);
  }
}

代码示例来源:origin: io.fabric8/fabric-openshift

protected void addMavenCoordinates(Element owner, Parser parser, int indent) {
  String group = groupId(parser);
  createAndAppendChild(owner, "groupId", indent, group);
  createAndAppendChild(owner, "artifactId", indent, parser.getArtifact());
  createAndAppendChild(owner, "version", indent, parser.getVersion());
  String type = parser.getType();
  if (type != null && !Objects.equal("jar", type)) {
    createAndAppendChild(owner, "type", indent, type);
  }
  String classifier = parser.getClassifier();
  if (Strings.isNotBlank(classifier)) {
    createAndAppendChild(owner, "classifier", indent, classifier);
  }
}

相关文章