Package 

Class BooleanExtensions

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static String coalesce(Boolean $self, String trueValue, String falseValue, String nullValue) 合并作为参数的值,将当前布尔值转化为对象。
      final static Boolean onTrue(Boolean $self, Function0<Unit> block) 如果为true,则执行一段代码。总是返回自身。
      final static Boolean onFalse(Boolean $self, Function0<Unit> block) 如果为false,则执行一段代码。总是返回自身。
      final static Byte toByte(Boolean $self) 将当前布尔值转化为字节类型的1或0。
      final static Short toShort(Boolean $self) 将当前布尔值转化为短整数类型的1或0。
      final static Integer toInt(Boolean $self) 将当前布尔值转化为整数类型的1或0。
      final static Long toLong(Boolean $self) 将当前布尔值转化为长整数类型的1或0。
      final static Float toFloat(Boolean $self) 将当前布尔值转化为单精度浮点数类型的1或0。
      final static Double toDouble(Boolean $self) 将当前布尔值转化为双精度浮点数类型的1或0。
      final static String toStringTrueFalse(Boolean $self) 将当前布尔值转化为以"true"和"false"表示的字符串。
      final static String toStringYesNo(Boolean $self) 将当前布尔值转化为以"yes"和"no"表示的字符串。
      final static String toStringOnOff(Boolean $self) 将当前布尔值转化为以"on"和"off"表示的字符串。
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • onTrue

         final static Boolean onTrue(Boolean $self, Function0<Unit> block)

        如果为true,则执行一段代码。总是返回自身。

      • onFalse

         final static Boolean onFalse(Boolean $self, Function0<Unit> block)

        如果为false,则执行一段代码。总是返回自身。

      • toByte

         final static Byte toByte(Boolean $self)

        将当前布尔值转化为字节类型的1或0。

      • toShort

         final static Short toShort(Boolean $self)

        将当前布尔值转化为短整数类型的1或0。

      • toInt

         final static Integer toInt(Boolean $self)

        将当前布尔值转化为整数类型的1或0。

      • toLong

         final static Long toLong(Boolean $self)

        将当前布尔值转化为长整数类型的1或0。

      • toFloat

         final static Float toFloat(Boolean $self)

        将当前布尔值转化为单精度浮点数类型的1或0。

      • toDouble

         final static Double toDouble(Boolean $self)

        将当前布尔值转化为双精度浮点数类型的1或0。