Boolean Class

Contains methods for the Boolean primitive data type.

System

The following are methods for Boolean. All methods are static.

  • valueOf(stringToBoolean)

    Converts the specified string to a Boolean value and returns true if the specified string value is true. Otherwise, returns false.

  • valueOf(fieldValue)

    Converts the specified object to a Boolean value. Use this method to convert a history tracking field value or an object that represents a Boolean value.

Converts the specified string to a Boolean value and returns true if the specified string value is true. Otherwise, returns false.

public static Boolean valueOf(String stringToBoolean)

  • stringToBoolean: Type: String

Type: Boolean

If the specified argument is null, this method throws an exception.

Converts the specified object to a Boolean value. Use this method to convert a history tracking field value or an object that represents a Boolean value.

public static Boolean valueOf(Object fieldValue)

  • fieldValue: Type: Object

Type: Boolean

Use this method with the OldValue or NewValue fields of history sObjects, such as AccountHistory, when the field type corresponds to a Boolean type, like a checkbox field.