io.advantageous.boon.core.IO.print()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(132)

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

IO.print介绍

[英]Print a single object to the console. If null prints out >NULL< If char[] converts to String. If array prints out string version of array by first converting array to a list. If any object, then it uses the toString to print out the object.
[中]将单个对象打印到控制台。If null打印出>null<If char[]转换为字符串。If array通过首先将数组转换为列表来打印数组的字符串版本。如果有任何对象,则使用toString打印出该对象。

代码示例

代码示例来源:origin: io.advantageous.boon/boon-reflekt

/**
 * Prints an object to the console.
 *
 * @param message object to print.
 */
public static void println(Object message) {
  print(message);
  println();
}

代码示例来源:origin: com.github.advantageous/boon-reflekt

/**
 * Print a single object to the console.
 * If null prints out &gt;NULL&lt;
 * If char[] converts to String.
 * If array prints out string version of array
 * by first converting array to a list.
 * If any object, then it uses the toString to print out the object.
 *
 * @param message the object that you wish to print.
 */
public static void print(Object message) {
  if (message == null) {
    print("<NULL>");
  } else if (message instanceof char[]) {
    print(FastStringUtils.noCopyStringFromChars((char[]) message));
  } else if (message.getClass().isArray()) {
    print(Lists.toListOrSingletonList(message).toString());
  } else {
    print(message.toString());
  }
}

代码示例来源:origin: com.github.advantageous/boon-reflekt

/**
 * Prints an object to the console.
 *
 * @param message object to print.
 */
public static void println(Object message) {
  print(message);
  println();
}

代码示例来源:origin: io.advantageous.boon/boon-reflekt

/**
 * Print a single object to the console.
 * If null prints out &gt;NULL&lt;
 * If char[] converts to String.
 * If array prints out string version of array
 * by first converting array to a list.
 * If any object, then it uses the toString to print out the object.
 *
 * @param message the object that you wish to print.
 */
public static void print(Object message) {
  if (message == null) {
    print("<NULL>");
  } else if (message instanceof char[]) {
    print(FastStringUtils.noCopyStringFromChars((char[]) message));
  } else if (message.getClass().isArray()) {
    print(Lists.toListOrSingletonList(message).toString());
  } else {
    print(message.toString());
  }
}

代码示例来源:origin: io.advantageous.boon/boon-util

/**
 * Like print, but prints out a whole slew of objects on the same line.
 *
 * @param messages objects you want to print on the same line.
 */
public static void puts(Object... messages) {
  for (Object message : messages) {
    IO.print(message);
    if (!(message instanceof Terminal.Escape)) IO.print(' ');
  }
  IO.println();
}

代码示例来源:origin: com.github.advantageous/boon-reflekt

/**
 * <p>
 * Like puts but prints out each object on its own line.
 * If the object is a list or array,
 * then each item in the list gets printed out on its own line.
 * </p>
 *
 * @param messages the stuff you want to print out.
 */
public static void putl(Object... messages) {
  for (Object message : messages) {
    if (message instanceof Collection || Typ.isArray(message)) {
      Iterator iterator = Conversions.iterator(message);
      while (iterator.hasNext()) {
        puts(iterator.next());
      }
      continue;
    }
    print(message);
    println();
  }
  println();
}

代码示例来源:origin: io.advantageous.boon/boon-reflekt

/**
 * <p>
 * Like puts but prints out each object on its own line.
 * If the object is a list or array,
 * then each item in the list gets printed out on its own line.
 * </p>
 *
 * @param messages the stuff you want to print out.
 */
public static void putl(Object... messages) {
  for (Object message : messages) {
    if (message instanceof Collection || Typ.isArray(message)) {
      Iterator iterator = Conversions.iterator(message);
      while (iterator.hasNext()) {
        puts(iterator.next());
      }
      continue;
    }
    print(message);
    println();
  }
  println();
}

相关文章