Java Code Examples for com.google.ipc.invalidation.util.TextBuilder#toString()

The following examples show how to use com.google.ipc.invalidation.util.TextBuilder#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AndroidStrings.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Returns an object that lazily evaluates {@link #toCompactString} when {@link Object#toString}
 * is called.
 */
public static Object toLazyCompactString(final Intent intent) {
  return new Object() {
    @Override
    public String toString() {
      TextBuilder builder = new TextBuilder();
      AndroidStrings.toCompactString(builder, intent);
      return builder.toString();
    }
  };
}
 
Example 2
Source File: AndroidStrings.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Returns an object that lazily evaluates {@link #toCompactString} when {@link Object#toString}
 * is called.
 */
public static Object toLazyCompactString(final Intent intent) {
  return new Object() {
    @Override
    public String toString() {
      TextBuilder builder = new TextBuilder();
      AndroidStrings.toCompactString(builder, intent);
      return builder.toString();
    }
  };
}