The following are methods for Boolean. All methods are static.
public static Boolean valueOf(String stringToBoolean)
Type: Boolean
If the specified argument is null, this method throws an exception.
Boolean b = Boolean.valueOf('true'); System.assertEquals(true, b);
public static Boolean valueOf(Object fieldValue)
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.
List<AccountHistory> ahlist = [SELECT Field,OldValue,NewValue FROM AccountHistory]; for(AccountHistory ah : ahlist) { System.debug('Field: ' + ah.Field); if (ah.field == 'IsPlatinum__c') { Boolean oldValue = Boolean.valueOf(ah.OldValue); Boolean newValue = Boolean.valueOf(ah.NewValue); }