// Fill out type (camel casing of the object type)
extraMetadata.put("targetType", target.getClass().getSimpleName());
// Fill out the SobaObject information
if (target instanceof SobaObject) {
SobaObject tSobaObject = (SobaObject) target;
// Attempt to gather the user/account from the target of the event when there is no user logged in.
// We can only do this for subclasses of SobaObject because the other two objects that create events
// (Account/User) can only provide one piece of the puzzle.
if (user == null) {
user = tSobaObject.getUser();
account = tSobaObject.getAccount();
}
extraMetadata.put("targetVisibility", tSobaObject.getVisibility());
extraMetadata.put("targetAlias", tSobaObject.getAlias());
extraMetadata.put("targetHashtags", tSobaObject.getHashtags());
}
// Fill in specific object information
if (target instanceof Account) {
Account tAccount = (Account) target;