java.lang.Boolean Maven / Gradle / Ivy
The newest version!
/*
This is not an official specification document, and usage is restricted.
NOTICE
(c) 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
Neither this file nor any files generated from it describe a complete
specification, and they may only be used as described below. For
example, no permission is given for you to incorporate this file, in
whole or in part, in an implementation of a Java specification.
Sun Microsystems Inc. owns the copyright in this file and it is provided
to you for informative, as opposed to normative, use. The file and any
files generated from it may be used to generate other informative
documentation, such as a unified set of documents of API signatures for
a platform that includes technologies expressed as Java APIs. The file
may also be used to produce "compilation stubs," which allow
applications to be compiled and validated for such platforms.
Any work generated from this file, such as unified javadocs or compiled
stub files, must be accompanied by this notice in its entirety.
This work corresponds to the API signatures of JSR 219: Foundation
Profile 1.1. In the event of a discrepency between this work and the
JSR 219 specification, which is available at
http://www.jcp.org/en/jsr/detail?id=219, the latter takes precedence.
*/
package java.lang;
/**
* The Boolean class wraps a value of the primitive type
* boolean
in an object. An object of type
* Boolean
contains a single field whose type is
* boolean
.
*
* In addition, this class provides many methods for
* converting a boolean
to a String
and a
* String
to a boolean
, as well as other
* constants and methods useful when dealing with a
* boolean
.
*
* @author Arthur van Hoff
* @version 1.38, 02/02/00
* @since JDK1.0
*/
public final class Boolean implements java.io.Serializable
{
/**
* The Boolean
object corresponding to the primitive
* value true
.
*/
public static final java.lang.Boolean TRUE = null;
/**
* The Boolean
object corresponding to the primitive
* value false
.
*/
public static final java.lang.Boolean FALSE = null;
/**
* The Class object representing the primitive type boolean.
*
* @since JDK1.1
*/
public static final java.lang.Class TYPE = null;
/**
* The value of the Boolean.
*
* @serial
*/
private boolean value;
/** use serialVersionUID from JDK 1.0.2 for interoperability */
private static final long serialVersionUID = -3665804199014368530L;
/**
* Allocates a Boolean
object representing the
* value
argument.
*
*
Note: It is rarely appropriate to use this constructor.
* Unless a new instance is required, the static factory
* {@link #valueOf(boolean)} is generally a better choice. It is
* likely to yield significantly better space and time performance.
*
* @param value the value of the Boolean
.
*/
public Boolean(boolean value) { }
/**
* Allocates a Boolean
object representing the value
* true
if the string argument is not null
* and is equal, ignoring case, to the string "true"
.
* Otherwise, allocate a Boolean
object representing the
* value false
. Examples:
* new Boolean("True") produces a Boolean object
* that represents true.
* new Boolean("yes") produces a Boolean object
* that represents false.
*
* @param s the string to be converted to a Boolean
.
*/
public Boolean(java.lang.String s) { }
/**
* Returns the value of this Boolean object as a boolean
* primitive.
*
* @return the primitive boolean
value of this object.
*/
public boolean booleanValue() {
return false;
}
/**
* Returns a Boolean instance representing the specified
* boolean value. If the specified boolean value
* is true, this method returns Boolean.TRUE;
* if it is false, this method returns Boolean.FALSE.
* If a new Boolean instance is not required, this method
* should generally be used in preference to the constructor
* {@link #Boolean(boolean)}, as this method is likely to to yield
* significantly better space and time performance.
*
* @param b a boolean value.
* @return a Boolean instance representing b.
* @since 1.4
*/
public static java.lang.Boolean valueOf(boolean b) {
return null;
}
/**
* Returns a Boolean
with a value represented by the
* specified String. The Boolean
returned represents the
* value true
if the string argument is not null
* and is equal, ignoring case, to the string "true"
.
* Example: Boolean.valueOf("True") returns true.
* Example: Boolean.valueOf("yes") returns false.
*
* @param s a string.
* @return the Boolean
value represented by the string.
*/
public static java.lang.Boolean valueOf(java.lang.String s) {
return null;
}
/**
* Returns a String object representing the specified
* boolean. If the specified boolean is true
, then
* the string "true" will be returned, otherwise the
* string "false" will be returned.
*
* @param b the boolean to be converted
* @return the string representation of the specified boolean
* @since 1.4
*/
public static java.lang.String toString(boolean b) {
return null;
}
/**
* Returns a String object representing this Boolean's
* value. If this object represents the value true
,
* a string equal to "true"
is returned. Otherwise, a
* string equal to "false"
is returned.
*
* @return a string representation of this object.
*/
public java.lang.String toString() {
return null;
}
/**
* Returns a hash code for this Boolean object.
*
* @return the integer 1231 if this object represents
* true; returns the integer 1237 if this
* object represents false.
*/
public int hashCode() {
return 0;
}
/**
* Returns true
if and only if the argument is not
* null
and is a Boolean
object that
* represents the same boolean
value as this object.
*
* @param obj the object to compare with.
* @return true
if the Boolean objects represent the
* same value; false
otherwise.
*/
public boolean equals(java.lang.Object obj) {
return false;
}
/**
* Returns true
if and only if the system property
* named by the argument exists and is equal to the string
* "true"
. (Beginning with version 1.0.2 of the
* JavaTM platform, the test of
* this string is case insensitive.) A system property is accessible
* through getProperty
, a method defined by the
* System
class.
*
* If there is no property with the specified name, or if the specified
* name is empty or null, then false
is returned.
*
* @param name the system property name.
* @return the boolean
value of the system property.
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
public static boolean getBoolean(java.lang.String name) {
return false;
}
}