Module JavaBoolean

module JavaBoolean: sig .. end
Utility functions for boolean type and Boolean class.


Instance creation

 
type t = java'lang'Boolean java_instance
The type of wrappers for boolean values.
 
val false_ : t
The constant for the wrapper around the false value.
 
val true_ : t
The constant for the wrapper around the true value.
 
val make : java_boolean -> t
Returns a new java.lang.Boolean wrapper for the passed value.
 
val make_of_string : JavaString.t -> t
Returns a new java.lang.Boolean corresponding to the passed string; see Boolean(...).
 

Operations

 
val boolean_value : t -> java_boolean
Returns the wrapped value.
 
val compare : java_boolean -> java_boolean -> java_int
Compares the passed values.
 
val compare_to : t -> t -> java_int
Compares the passed values.
 
val parse_boolean : JavaString.t -> java_boolean
Converts the passed string into a boolean; see parseBoolean(...).
 
val to_string : java_boolean -> JavaString.t
Converts the passed boolean into a string; see toString(...).
 
val value_of : java_boolean -> t
Converts the passed bare boolean into a boolean wrapper; see valueOf(...).
 
val value_of_string : JavaString.t -> t
Converts the passed string into a boolean wrapper; see valueOf(...).
 

Null value

 
val null : t
The null value.
 
val is_null : t -> bool
is_null obj returns true iff obj is equal to null.
 
val is_not_null : t -> bool
is_not_null obj returns false iff obj is equal to null.
 

Miscellaneous

 
val wrap : t -> t option
wrap obj wraps the reference obj into an option type:
  • Some x if obj is not null;
  • None if obj is null.

 
val unwrap : t option -> t
unwrap obj unwraps the option obj into a bare reference:
  • Some x is mapped to x;
  • None is mapped to null.