Show: |
Objects
Signature
public inherited sharing class Objects
Objects Methods
requireEquals(entry, comparable)
Checks if the provided entry object is null or not equal to the comparable object and throws an IllegalArgumentException if either condition is true.
Signature
public static void requireEquals(Object entry, Object comparable)
Parameters
entry
Type:
Object
the object to check for nullity and equality
comparable
Type:
Object
the object to compare with the entry object
Exceptions
IllegalArgumentException if the provided entry object is null or not equal to the comparable object
requireEquals(entry, comparable, message)
Checks if the provided entry object is null or not equal to the comparable object and throws an IllegalArgumentException if either condition is true.
Signature
public static void requireEquals( Object entry, Object comparable, String message )
Parameters
entry
Type:
Object
the object to check for nullity and equality
comparable
Type:
Object
the object to compare with the entry object
message
Type:
String
the message to use for the exception if the entry object is null or not equal to the comparable object. If this is null, a default message is used.
Exceptions
IllegalArgumentException if the provided entry object is null or not equal to the comparable object
requireEqualsType(entry, comparable)
Checks if the provided entry object is null or not equal to the comparable SObjectType and throws an IllegalArgumentException if either condition is true.
Signature
public static void requireEqualsType( SObject entry, Schema.SObjectType comparable )
Parameters
entry
Type:
SObject
the SObject to check for nullity and equality
comparable
Type:
Schema.SObjectType
the SObjectType to compare with the entry object
Exceptions
IllegalArgumentException if the provided entry object is null or not equal to the comparable SObjectType
requireEqualsType(entry, comparable, message)
Checks if the provided entry object is null or not equal to the comparable SObjectType and throws an IllegalArgumentException if either condition is true.
Signature
public static void requireEqualsType( SObject entry, Schema.SObjectType comparable, String message )
Parameters
entry
Type:
SObject
the SObject to check for nullity and equality
comparable
Type:
Schema.SObjectType
the SObjectType to compare with the entry object
message
Type:
String
the message to use for the exception if the entry object is null or not equal to the comparable SObjectType. If this is null, a default message is used.
Exceptions
IllegalArgumentException if the provided entry object is null or not equal to the comparable SObjectType
requireEqualsType(entry, comparable)
Checks if the provided entry ID is null or not equal to the comparable SObjectType and throws an IllegalArgumentException if either condition is true. If no custom message is provided, a default message is used.
Signature
public static void requireEqualsType( Id entry, Schema.SObjectType comparable )
Parameters
entry
Type:
Id
the ID to check for nullity and equality
comparable
Type:
Schema.SObjectType
the SObjectType to compare with the entry ID
Exceptions
IllegalArgumentException if the provided entry ID is null or not equal to the comparable SObjectType
requireEqualsType(entry, comparable, message)
Checks if the provided entry ID's SObjectType is null or not equal to the comparable SObjectType and throws an IllegalArgumentException if either condition is true.
Signature
public static void requireEqualsType( Id entry, Schema.SObjectType comparable, String message )
Parameters
entry
Type:
Id
the ID whose SObjectType is to be checked for nullity and equality
comparable
Type:
Schema.SObjectType
the SObjectType to compare with the SObjectType of the entry ID
message
Type:
String
the message to use for the exception if the SObjectType of the entry ID is null or not equal to the comparable SObjectType
Exceptions
IllegalArgumentException if the SObjectType of the provided entry ID is null or not equal to the comparable SObjectType
requireEqualsType(entry, comparable)
Checks if the provided list of SObjects is null or if their SObjectType is not equal to the comparable SObjectType and throws an IllegalArgumentException if either condition is true. If no custom message is provided, a default message is used.
Signature
public static void requireEqualsType( List<SObject> entry, Schema.SObjectType comparable )
Parameters
entry
Type:
List<SObject>
the list of SObjects to check for nullity and equality of SObjectType
comparable
Type:
Schema.SObjectType
the SObjectType to compare with the SObjectType of the entry SObjects
Exceptions
IllegalArgumentException if the provided list of SObjects is null or if their SObjectType is not equal to the comparable SObjectType
requireEqualsType(entry, comparable, message)
Checks if the provided list of SObjects is null or if their SObjectType is not equal to the comparable SObjectType and throws an IllegalArgumentException if either condition is true.
Signature
public static void requireEqualsType( List<SObject> entry, Schema.SObjectType comparable, String message )
Parameters
entry
Type:
List<SObject>
the list of SObjects to check for nullity and equality of SObjectType
comparable
Type:
Schema.SObjectType
the SObjectType to compare with the SObjectType of the entry SObjects
message
Type:
String
the message to use for the exception if the list of SObjects is null or if their SObjectType is not equal to the comparable SObjectType
Exceptions
IllegalArgumentException if the provided list of SObjects is null or if their SObjectType is not equal to the comparable SObjectType
requireInstanceOf(entry, type)
Checks if the provided object is null or not an instance of the specified type and throws an IllegalArgumentException if either condition is true. If no custom message is provided, a default message is used.
Signature
public static void requireInstanceOf(Object entry, System.Type type)
Parameters
entry
Type:
Object
the object to check for nullity and type
type
Type:
System.Type
the type to check the object against
Exceptions
IllegalArgumentException if the provided object is null or not an instance of the specified type
requireInstanceOf(entry, type, message)
Checks if the provided object is null or not an instance of the specified type and throws an IllegalArgumentException if either condition is true.
Signature
public static void requireInstanceOf( Object entry, System.Type type, String message )
Parameters
entry
Type:
Object
the object to check for nullity and type
type
Type:
System.Type
the type to check the object against
message
Type:
String
the message to use for the exception if the object is null or not an instance of the specified type
Exceptions
IllegalArgumentException if the provided object is null or not an instance of the specified type
requireNonEmptyCollection(entry)
Checks if the provided collection is null or empty and throws an IllegalArgumentException if it is. If no custom message is provided, a default message is used.
Signature
public static void requireNonEmptyCollection(List<Object> entry)
Parameters
entry
Type:
List<Object>
the collection to check for nullity or emptiness
Exceptions
IllegalArgumentException if the provided collection is null or empty
requireNonEmptyCollection(entry, message)
Checks if the provided collection is null or empty and throws an IllegalArgumentException if it is.
Signature
public static void requireNonEmptyCollection( List<Object> entry, String message )
Parameters
entry
Type:
List<Object>
the collection to check for nullity or emptiness
message
Type:
String
the message to use for the exception if the collection is null or empty
Exceptions
IllegalArgumentException if the provided collection is null or empty
requireNonNull(obj)
Checks if the provided object is null and throws an IllegalArgumentException if it is.
Signature
public static void requireNonNull(Object obj)
Parameters
obj
Type:
Object
the object to check for nullity
Exceptions
IllegalArgumentException if the provided object is null
requireNonNull(obj, message)
Checks if the provided object is null and throws an IllegalArgumentException if it is.
Signature
public static void requireNonNull(Object obj, String message)
Parameters
obj
Type:
Object
the object to check for nullity
message
Type:
String
the message to use for the exception if the object is null. If this is null, a default message is used.
Exceptions
IllegalArgumentException if the provided object is null
|