Examples of Joiner


Examples of com.google.common.base.Joiner

    return stringList;
  }

  public String toString() {
    Joiner joiner = Joiner.on(" ").skipNulls();
    return joiner.join(getArgumentsAsStringList());
  }
View Full Code Here

Examples of com.google.common.base.Joiner

    }

    @NotNull
    @Override
    public String getPresentableString() {
      Joiner joiner = Joiner.on("|");
      return "(" + joiner.join(PREFIXES) + ").*(" + joiner.join(DOT_SUFFIXES) + ")";
    }
View Full Code Here

Examples of com.google.common.base.Joiner

     *                   of the quorum
     */
    @Override
    protected Result check() throws Exception {
        final List<ZooKeeperHealthCheck> unhealthy = getUnhealthy();
        final Joiner joiner = Joiner.on(", ");

        if (unhealthy.isEmpty()) {
            return Result.healthy();
        } else if (unhealthy.size() < healthChecks.size()) {
            return Result.unhealthy(String.format(
                    "Some nodes are unhealthy: %s", joiner.join(unhealthy)));
        } else {
            return Result.unhealthy(String.format(
                    "All nodes are unhealthy: %s", joiner.join(unhealthy)));
        }
    }
View Full Code Here

Examples of com.google.common.base.Joiner

        }

        if (!resourceConfigs.isEmpty()) {
            command.add("-c");

            Joiner joiner = Joiner.on(',');
            command.add(joiner.join(resourceConfigs));
        }

        if (symbolOutputDir != null &&
                (type == VariantConfiguration.Type.LIBRARY || !libraries.isEmpty())) {
            command.add("--output-text-symbols");
View Full Code Here

Examples of com.google.common.base.Joiner

    @Override
    public HttpResponse executeDirect(HttpRequest request) {

        HttpUriRequest httpUriRequest = null;

        Joiner joiner = Joiner.on(",").skipNulls();
        URI requestUri = buildUri(request, joiner);

        httpUriRequest = buildHttpUriRequest(request, joiner, requestUri);

        try {
View Full Code Here

Examples of com.google.common.base.Joiner

//            }
//        });

        HttpUriRequest httpUriRequest = null;

        Joiner joiner = Joiner.on(",").skipNulls();
        URI requestUri = buildUri(request, joiner);

        httpUriRequest = buildHttpUriRequest(request, joiner, requestUri);

View Full Code Here

Examples of com.google.common.base.Joiner

        "Resource request can not be null.");
    Set<String> dedupedRacks = new HashSet<String>();
    if (req.getRacks() != null) {
      dedupedRacks.addAll(req.getRacks());
      if(req.getRacks().size() != dedupedRacks.size()) {
        Joiner joiner = Joiner.on(',');
        LOG.warn("ContainerRequest has duplicate racks: "
            + joiner.join(req.getRacks()));
      }
    }
    Set<String> inferredRacks = resolveRacks(req.getNodes());
    inferredRacks.removeAll(dedupedRacks);

    // check that specific and non-specific requests cannot be mixed within a
    // priority
    checkLocalityRelaxationConflict(req.getPriority(), ANY_LIST,
        req.getRelaxLocality());
    // check that specific rack cannot be mixed with specific node within a
    // priority. If node and its rack are both specified then they must be
    // in the same request.
    // For explicitly requested racks, we set locality relaxation to true
    checkLocalityRelaxationConflict(req.getPriority(), dedupedRacks, true);
    checkLocalityRelaxationConflict(req.getPriority(), inferredRacks,
        req.getRelaxLocality());

    if (req.getNodes() != null) {
      HashSet<String> dedupedNodes = new HashSet<String>(req.getNodes());
      if(dedupedNodes.size() != req.getNodes().size()) {
        Joiner joiner = Joiner.on(',');
        LOG.warn("ContainerRequest has duplicate nodes: "
            + joiner.join(req.getNodes()));       
      }
      for (String node : dedupedNodes) {
        addResourceRequest(req.getPriority(), node, req.getCapability(), req,
            true);
      }
View Full Code Here

Examples of com.google.common.base.Joiner

        }

        if (!resourceConfigs.isEmpty()) {
            command.add("-c");

            Joiner joiner = Joiner.on(',');
            command.add(joiner.join(resourceConfigs));
        }

        if (symbolOutputDir != null &&
                (type == VariantConfiguration.Type.LIBRARY || !libraries.isEmpty())) {
            command.add("--output-text-symbols");
View Full Code Here

Examples of com.google.common.base.Joiner

  public static Map<Unit<?>, String> verboseNamesPlur = Maps.newHashMap();

  private static Set<String> dontUse = Sets.newHashSet("in");

  private static void addParsers(final Set<UnitParser> ret, final Class<? extends SystemOfUnits> cls) {
    final Joiner joiner = Joiner.on(' ');
    for (final Field f : cls.getDeclaredFields()) {
      if (!Modifier.isStatic(f.getModifiers())) {
        continue;
      }
      final Class<?> fieldType = f.getType();
      if (Unit.class.isAssignableFrom(fieldType)) {
        final Object[] longName = f.getName().toLowerCase().split("_");
        // Don't do this if its a single word of less than 3 characters,
        // it's too easily misinterpreted
        if (longName.length == 1 && longName[0].toString().length() < 3) {
          continue;
        }
        try {
          final Unit<?> unit = (Unit<?>) f.get(null);
          if (longName.length > 0) {
            ret.add(new UnitParser(unit, TokenList.create(Lists.newArrayList(longName))));
            verboseNamesSing.put(unit, joiner.join(longName));
            // And pluralize
            if (longName[0].toString().charAt(longName[0].toString().length() - 1) != 's') {
              final ArrayList<Object> pluralLongName = Lists.<Object> newArrayList(longName);
              pluralLongName.set(0, pluralLongName.get(0) + "s");
              ret.add(new UnitParser(unit, TokenList.create(pluralLongName)));
              verboseNamesPlur.put(unit, joiner.join(pluralLongName));
            }
          }
          final TokenList shortName = Tokenizer.tokenize(unit.toString());
          // Don't use it if it is only one character, or if its in a
          // list of confusing values like "in"
View Full Code Here

Examples of com.google.common.base.Joiner

   private void setAvailableVirtualDatacenters(final List<Integer> ids) {
      if (ids == null || ids.size() == 0) {
         target.setAvailableVirtualDatacenters("");
      } else {
         Joiner joiner = Joiner.on(",").skipNulls();
         target.setAvailableVirtualDatacenters(joiner.join(ids));
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.