Java Number Negate negate(final Boolean bool)

Here you can find the source of negate(final Boolean bool)

Description

Method to negate a Boolean

License

Open Source License

Parameter

Parameter Description
bool a parameter

Declaration

public static Boolean negate(final Boolean bool) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from  w  w w  .  jav  a2s . c o  m
     * Method to negate a Boolean
     * 
     * @param bool
     * @return {@link Boolean}
     */
    public static Boolean negate(final Boolean bool) {
        if (bool == null) {
            return null;
        }
        return bool.booleanValue() ? Boolean.FALSE : Boolean.TRUE;
    }
}

Related

  1. negate(boolean[] posit)
  2. negate(Comparable v)
  3. negate(double[] a)
  4. negate(double[] output, double[] a)
  5. negate(double[] values)
  6. negate(int[] ar)
  7. negate(int[] input)
  8. negate(int[] x, int Max)
  9. negate(String expr)