A container object which may or may not contain a non-null
SObject record. If a record is present,
isPresent() will return true and
get() will return the record. Additional methods that depend on the presence or absence of a contained record are provided, such as
orElse() (return a default record if record not present) or
orElseThrow (throw an exception if a record is not present).
true if a record is present.
Returns the record when it is present. Throws a
System.NoSuchElementException when it is not.
Returns a record when it is present, or
other when it is not.
SObject orElse(SObject other)
Returns a record when it is present, or throws
e when it is not.
SObject orElseThrow(Exception e)