当前位置: 首页>>代码示例>>Java>>正文


Java Joiner类代码示例

本文整理汇总了Java中com.google.api.client.repackaged.com.google.common.base.Joiner的典型用法代码示例。如果您正苦于以下问题:Java Joiner类的具体用法?Java Joiner怎么用?Java Joiner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Joiner类属于com.google.api.client.repackaged.com.google.common.base包,在下文中一共展示了Joiner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getChannels

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
@Override
public List<Channel> getChannels(List<String> channelIds)
{
	try
	{
		YouTube.Channels.List channels = getTubeService().channels().list("snippet");
		channels.setKey(getApiKey());
		channels.setId(Joiner.on(",").join(channelIds));
		ChannelListResponse channelListResponse = channels.execute();

		return channelListResponse.getItems();
	}
	catch( Exception ex )
	{
		throw Throwables.propagate(ex);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:18,代码来源:GoogleServiceImpl.java

示例2: getVideos

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
@Override
public List<Video> getVideos(List<String> videoIds)
{
	try
	{
		YouTube.Videos.List videos = getTubeService().videos().list("id,snippet,player,contentDetails,statistics");
		videos.setKey(getApiKey());
		videos.setId(Joiner.on(",").join(videoIds));
		VideoListResponse vlr = videos.execute();

		return vlr.getItems();
	}
	catch( Exception ex )
	{
		throw Throwables.propagate(ex);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:18,代码来源:GoogleServiceImpl.java

示例3: toString

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
@Override
public String toString() {
    List<String> terms = new ArrayList<String>();

    addTerm(terms, allTerms, "AND", null);
    addTerm(terms, someTerms, "OR", null);
    if (phrase != null) {
        terms.add("\"" + phrase + "\"");
    }
    if (exclude != null) {
        terms.add("-(" + exclude + ")");
    }
    addTerm(terms, siteTypes, "OR", "site_type");
    addTerm(terms, language, "OR", "language");
    addTerm(terms, sites, "OR", "site");
    addTerm(terms, persons, "OR", "person");
    addTerm(terms, locations, "OR", "location");
    addTerm(terms, organizations, "OR", "organization");
    if (title != null) {
        terms.add("title:(" + title + ")");
    }
    if (bodyText != null) {
        terms.add("text:(" + bodyText+ ")");
    }
    return Joiner.on(" AND ").join(terms);
}
 
开发者ID:Buzzilla,项目名称:webhose-java,代码行数:27,代码来源:WebhoseQuery.java

示例4: getQueryForSentence

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
/**
 * Returns the query for a sentence by configured tags
 *
 * @param sentence i.e. "Ich ging in den dunklen Wald"
 * @return i.e. "dunklen Wald"
 */
public String getQueryForSentence(String sentence) {

    log.debug("getQueryForSentence in: " + sentence);
    if (sentence == null) {
        return null;
    }

    String words[] = sentence.split(" ");
    String wordsTags[] = postagger.tag(words);
    LinkedHashSet<String> wordsResult = new LinkedHashSet<String>();

    for (int i = 0; i < wordsTags.length; i++) {
        if (tags.contains(wordsTags[i])) {
            wordsResult.add(words[i]);
        }
    }

    String result = Joiner.on(" ").join(wordsResult);
    log.debug("getQueryForSentence result: " + result);
    return result;
}
 
开发者ID:jmoennich,项目名称:bilderbuch,代码行数:28,代码来源:SentenceService.java

示例5: resolve

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
public ImmutableSet<EquivalenceGraph> resolve(EquivalenceGraphUpdate graphUpdate) {
    ImmutableSet<Id> graphIds = graphUpdate.getAllGraphs()
            .stream()
            .map(EquivalenceGraph::getId)
            .collect(MoreCollectors.toImmutableSet());

    try {
        return graphStore.resolveIds(graphIds).get()
                .values()
                .stream()
                .filter(Optional::isPresent)
                .map(Optional::get)
                .collect(MoreCollectors.toImmutableSet());

    } catch (InterruptedException | ExecutionException e) {
        log.error("Failed to resolve equivalence graphs for {}", Joiner.on(",").join(graphIds));
        throw Throwables.propagate(e);
    }
}
 
开发者ID:atlasapi,项目名称:atlas-deer,代码行数:20,代码来源:EquivalenceGraphUpdateResolver.java

示例6: showDetails

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
public void showDetails(Book book, Drawable thumb) {
  Log.d(TAG, "Show details on " + book.getId());
  // Reset the scroll view if this is a different from previous book
  if (current != null && !current.getId().equals(book.getId())) {
    scrollView.scrollTo(0,0);
  }

  // Show mandatory info
  current = book;
  title.setText(book.getTitle());
  if (book.getAuthors() != null) {
    authors.setText(Joiner.on(", ").join(book.getAuthors()));
  } else {
    authors.setText(null);
  }
  Integer count = book.getPageCount();
  if (count != null) {
    String pageString = pages.getResources().getString(R.string.pages, count);
    pages.setText(pageString);
  } else {
    pages.setText(null);
  }

  preloadedDrawable = thumb;
  setSaleInfo(current);

  if (book.getDetails() == null) {
    if (thumb != null) {
      picture.setImageDrawable(thumb.getCurrent());
    } else {
      picture.setImageResource(R.drawable.user_placeholder);
    }
    detailsLoader.doSearch(book);
  } else {
    onDetailsLoaded(book);
  }
}
 
开发者ID:andviane,项目名称:google-books-android-viewer,代码行数:38,代码来源:BookDetailsFragment.java

示例7: setAuthors

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
private void setAuthors(List<String> authorList) {
  int visibility;
  if (authorList != null && !authorList.isEmpty()) {
    String join = Joiner.on(", ").join(authorList);
    authors.setText(join);
    visibility = View.VISIBLE;
  } else {
    visibility = View.GONE;
  }
  authors.setVisibility(visibility);
}
 
开发者ID:andviane,项目名称:google-books-android-viewer,代码行数:12,代码来源:BookViewHolder.java

示例8: getAllEntries

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
private List<String> getAllEntries(ListFeed listFeed, String[] headerDefault)
  {
      List<String> returnValue = Lists.newArrayList();
Joiner joiner = Joiner.on(Properties.inputDelimiter.get());
Set<String> header = null;
List<ListEntry> entries = listFeed.getEntries();
if (entries != null && entries.size() > 0) {
	ListEntry listEntry = entries.get(0);
	if (listEntry != null)
		header = listEntry.getCustomElements().getTags();
}
if (header == null && headerDefault != null) {
	header = new LinkedHashSet<String>();
	for (String headerItem : headerDefault) {
		header.add(headerItem);
	}
}
      returnValue.add(joiner.join(header));
      for (ListEntry row : entries) {
          List<String> rowValues = Lists.newArrayList();
          for (String tag : header) {
              String value = row.getCustomElements().getValue(tag);
              if (value == null)
                  value = "";
              rowValues.add(value);
          }
          String rowValuesString = joiner.join(rowValues);
          returnValue.add(rowValuesString);
      }
      return returnValue;
  }
 
开发者ID:Netflix,项目名称:q,代码行数:32,代码来源:GoogleSheetsService.java

示例9: toRemotePaths

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
public static String toRemotePaths(List<FilePath> importPaths) {
  return Joiner.on(',').join(transform(importPaths, new Function<FilePath, String>() {
    @Override
    public String apply(FilePath input) {
      return input.getRemote();
    }
  }));
}
 
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:9,代码来源:PathUtils.java

示例10: constructMessage

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
private static String constructMessage(String message, HttpResponseException exception) {
    try {
        ErrorBody body = Json.getInstance().fromJson(exception.getContent(), ErrorBody.class);
        if (body.errors.size() > 0) {
            return message + " (" + Joiner.on("; ").join(body.errors) + ")";
        }
    } catch (Exception e) {
    }
    return message;
}
 
开发者ID:Asana,项目名称:java-asana,代码行数:11,代码来源:AsanaError.java

示例11: init

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
@Before public void init() throws IOException {
  sparkRunner = SparkPipelineRunner.create();
  directRunner = DirectPipelineRunner.createForTest();
  testDataDirName = Joiner.on(File.separator).join("target", "test-data", name.getMethodName())
      + File.separator;
  FileUtils.deleteDirectory(new File(testDataDirName));
  new File(testDataDirName).mkdirs();
}
 
开发者ID:shakamunyi,项目名称:spark-dataflow,代码行数:9,代码来源:TransformTranslatorTest.java

示例12: runPipeline

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
private String runPipeline(String name, PipelineRunner<?> runner) {
  Pipeline p = Pipeline.create(PipelineOptionsFactory.create());
  String outFile = Joiner.on(File.separator).join(testDataDirName, "test_text_out_" + name);
  PCollection<String> lines =  p.apply(TextIO.Read.from("src/test/resources/test_text.txt"));
  lines.apply(TextIO.Write.to(outFile));
  runner.run(p);
  return outFile;
}
 
开发者ID:shakamunyi,项目名称:spark-dataflow,代码行数:9,代码来源:TransformTranslatorTest.java

示例13: onPreMessageReceived

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
@Override
public Message onPreMessageReceived(Peer peer, Message m) {
	if (m instanceof Pong) {
		// nothing
	} else if (m instanceof InventoryMessage) {
		InventoryMessage inv = (InventoryMessage) m;
		log.info("[MESSAGE INV] size={}\nitem={}",
				inv.getItems().size(),
				Joiner.on(",").join(Lists.transform(inv.getItems(), FunInvItemToString)));
	} else {
		log.info("[MESSAGE] = {}", m);
	}
	return super.onPreMessageReceived(peer, m);
}
 
开发者ID:y12studio,项目名称:bkbc-tools,代码行数:15,代码来源:DebugPeerEventListener.java

示例14: getInfo

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
public String getInfo()
{
	ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
	if (getRawScore() != null)
	{
		builder.put(CaddAnnotator.CADD_ABS, getRawScore().toString());
	}
	if (getPhred() != null)
	{
		builder.put(CaddAnnotator.CADD_SCALED, getPhred().toString());
	}
	return Joiner.on(";").withKeyValueSeparator("=").join(builder.build());
	//		return "CADD=" + getRawScore() + ";CADD_SCALED=" + getPhred();
}
 
开发者ID:molgenis,项目名称:molgenis,代码行数:15,代码来源:CaddVariant.java

示例15: getJoinedContext

import com.google.api.client.repackaged.com.google.common.base.Joiner; //导入依赖的package包/类
public String getJoinedContext() {
    return context.isEmpty() ? "(root)" : Joiner.on("").join(context);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:4,代码来源:JsonDebugReader.java


注:本文中的com.google.api.client.repackaged.com.google.common.base.Joiner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。