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


Java Receiver类代码示例

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


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

示例1: toLazyCompactString

import com.google.common.base.Receiver; //导入依赖的package包/类
/**
 * Given an {@code element} to be logged lazily, returns null if the object is null. Otherwise,
 * return an object that would convert it to a string using {@code builderFunction}. I.e., this
 * method will call {@code builderFunction} with a new {@link TextBuilder} return the string
 * created with it.
 */
public static <T> Object toLazyCompactString(final T element,
    final Receiver<TextBuilder> builderFunction) {
  if (element == null) {
    return null;
  }
  return new Object() {
    @Override
    public String toString() {
      TextBuilder builder = new TextBuilder();
      builderFunction.accept(builder);
      return builder.toString();
    }
  };
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:21,代码来源:LazyString.java

示例2: toLazyCompactString

import com.google.common.base.Receiver; //导入依赖的package包/类
/** See spec in implementation notes. */
public static Object toLazyCompactString(final ObjectIdP objectId) {
  return LazyString.toLazyCompactString(objectId, new Receiver<TextBuilder>() {
    @Override
    public void accept(TextBuilder builder) {
      toCompactString(builder, objectId);
    }
  });
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:10,代码来源:CommonProtoStrings2.java

示例3: toLazyCompactStringForObjectIds

import com.google.common.base.Receiver; //导入依赖的package包/类
/** See spec in implementation notes. */
public static Object toLazyCompactStringForObjectIds(
    final Collection<ObjectIdP> objectIds) {
  return LazyString.toLazyCompactString(objectIds, new Receiver<TextBuilder>() {
    @Override
    public void accept(TextBuilder builder) {
      toCompactStringForObjectIds(builder, objectIds);
    }
  });
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:11,代码来源:CommonProtoStrings2.java

示例4: toLazyCompactStringForInvalidations

import com.google.common.base.Receiver; //导入依赖的package包/类
/** See spec in implementation notes. */
public static Object toLazyCompactStringForInvalidations(
    final Collection<InvalidationP> invalidations) {
  return LazyString.toLazyCompactString(invalidations, new Receiver<TextBuilder>() {
    @Override
    public void accept(TextBuilder builder) {
      toCompactStringForInvalidations(builder, invalidations);
    }
  });
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:11,代码来源:CommonProtoStrings2.java

示例5: toLazyCompactStringForRegistrations

import com.google.common.base.Receiver; //导入依赖的package包/类
/** See spec in implementation notes. */
public static Object toLazyCompactStringForRegistrations(
    final Collection<RegistrationP> registrations) {
  return LazyString.toLazyCompactString(registrations, new Receiver<TextBuilder>() {
    @Override
    public void accept(TextBuilder builder) {
      toCompactStringForRegistrations(builder, registrations);
    }
  });
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:11,代码来源:CommonProtoStrings2.java


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