Java Boolean From toBoolean(double value)

Here you can find the source of toBoolean(double value)

Description

to Boolean

License

Apache License

Declaration

public static boolean toBoolean(double value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean toBoolean(double value) {
        return value != 0.0;
    }// ww  w  .j av  a 2  s . c  o  m

    public static boolean toBoolean(long value) {
        return value != 0;
    }

    public static boolean toBoolean(int value) {
        return value != 0;
    }

    public static boolean toBoolean(short value) {
        return value != 0;
    }

    public static boolean toBoolean(byte value) {
        return value != 0;
    }

    public static boolean toBoolean(char ch) {
        return ch != 0;
    }

    public static boolean toBoolean(String value) {
        return value != null && !value.equals("0") && !value.isEmpty();
    }
}

Related

  1. toBoolean(byte[] byteArray)
  2. toBoolean(byte[] bytes, int offset)
  3. toBoolean(byte[] data, int offset)
  4. toBoolean(byte[] value)
  5. toBoolean(char c)
  6. toBoolean(final Boolean bool)
  7. toBoolean(final Boolean bool)
  8. toBoolean(final byte[] b)
  9. toBoolean(final Object obj, final boolean defaultValue)