Boolean Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The Boolean class wraps a value of the primitive type
boolean in an object.
[Android.Runtime.Register("java/lang/Boolean", DoNotGenerateAcw=true)]
public sealed class Boolean : Java.Lang.Object, IConvertible, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ISerializable, Java.Lang.IComparable
[<Android.Runtime.Register("java/lang/Boolean", DoNotGenerateAcw=true)>]
type Boolean = class
inherit Object
interface IConvertible
interface ISerializable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
interface IComparable
- Inheritance
- Attributes
- Implements
Remarks
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.
<!-- Android-removed: paragraph on ValueBased
This is a value-based class; programmers should treat instances that are #equals(Object) equal as interchangeable and should not use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, synchronization may fail. -->
Added in 1.0.
Java documentation for java.lang.Boolean.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
| Name | Description |
|---|---|
| Boolean(Boolean) |
Allocates a |
| Boolean(String) |
Allocates a |
Properties
| Name | Description |
|---|---|
| Class |
Returns the runtime class of this |
| False |
The |
| Handle |
The handle to the underlying Android instance. (Inherited from Object) |
| JniIdentityHashCode |
Gets the identity hash code assigned to this Java peer by the interop runtime. (Inherited from Object) |
| JniPeerMembers |
Gets the JNI metadata used to invoke members of this Java peer. |
| PeerReference |
Gets the JNI object reference for this Java peer. (Inherited from Object) |
| ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
| ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
| True |
The |
| Type |
The Class object representing the primitive type boolean. |
Methods
| Name | Description |
|---|---|
| BooleanValue() |
Returns the value of this |
| Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
| Compare(Boolean, Boolean) |
Compares two |
| CompareTo(Boolean) |
Compares this |
| Dispose() |
Releases the resources held by this Java peer. (Inherited from Object) |
| Dispose(Boolean) |
Releases the resources held by this Java peer. (Inherited from Object) |
| Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
| GetBoolean(String) |
Returns |
| GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
| HashCode(Boolean) |
Returns a hash code for a |
| JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
| LogicalAnd(Boolean, Boolean) |
Returns the result of applying the logical AND operator to the
specified |
| LogicalOr(Boolean, Boolean) |
Returns the result of applying the logical OR operator to the
specified |
| LogicalXor(Boolean, Boolean) |
Returns the result of applying the logical XOR operator to the
specified |
| Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
| NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
| ParseBoolean(String) |
Parses the string argument as a boolean. |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| ToArray<T>() |
Creates a managed array from this Java array wrapper. (Inherited from Object) |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| ToString(Boolean) |
Returns a |
| UnregisterFromRuntime() |
Unregisters this Java peer from the interop runtime. (Inherited from Object) |
| ValueOf(Boolean) |
Returns a |
| ValueOf(String) |
Returns a |
| Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
| Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
| Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Operators
| Name | Description |
|---|---|
| Explicit(Boolean to Boolean) |
Converts the specified |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IComparable.CompareTo(Object) |
Compares this value with the specified object for ordering. |
| IConvertible.GetTypeCode() |
Returns the type code for this value. |
| IConvertible.ToBoolean(IFormatProvider) |
Converts this value to |
| IConvertible.ToByte(IFormatProvider) |
Converts this value to |
| IConvertible.ToChar(IFormatProvider) |
Conversion to |
| IConvertible.ToDateTime(IFormatProvider) |
Conversion to |
| IConvertible.ToDecimal(IFormatProvider) |
Converts this value to |
| IConvertible.ToDouble(IFormatProvider) |
Converts this value to |
| IConvertible.ToInt16(IFormatProvider) |
Converts this value to |
| IConvertible.ToInt32(IFormatProvider) |
Converts this value to |
| IConvertible.ToInt64(IFormatProvider) |
Converts this value to |
| IConvertible.ToSByte(IFormatProvider) |
Converts this value to |
| IConvertible.ToSingle(IFormatProvider) |
Converts this value to |
| IConvertible.ToString(IFormatProvider) |
Converts this value to |
| IConvertible.ToType(Type, IFormatProvider) |
Converts this value to the type specified by |
| IConvertible.ToUInt16(IFormatProvider) |
Converts this value to |
| IConvertible.ToUInt32(IFormatProvider) |
Converts this value to |
| IConvertible.ToUInt64(IFormatProvider) |
Converts this value to |
| IJavaPeerable.Disposed() |
Notifies the interop runtime that this managed peer has been disposed. (Inherited from Object) |
| IJavaPeerable.DisposeUnlessReferenced() |
Releases this Java peer unless it is retained by another managed reference. (Inherited from Object) |
| IJavaPeerable.Finalized() |
Notifies the interop runtime that this managed peer has been finalized. (Inherited from Object) |
| IJavaPeerable.JniManagedPeerState |
Gets the state that describes the relationship between this managed peer and its JNI reference. (Inherited from Object) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) |
Sets the interop identity hash code for this Java peer. (Inherited from Object) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
Sets the managed and JNI peer state for this Java peer. (Inherited from Object) |
| IJavaPeerable.SetPeerReference(JniObjectReference) |
Sets the JNI object reference used by this managed peer. (Inherited from Object) |
Extension Methods
| Name | Description |
|---|---|
| GetJniTypeName(IJavaPeerable) |
Gets the JNI name of the type of the instance |
| JavaAs<TResult>(IJavaPeerable) |
Try to coerce |
| JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
| JavaCast<TResult>(IJavaObject) | |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
Try to coerce |