public ObjectId getObjectId(final String field, final ObjectId def) {
    """
	Returns the object id or def if not set.
	
	@param field The field to return
	@param def   the default value in case the field is not found
	@return The field object value or def if not set.
    """
        Object foo = get(field);
        return (foo != null) ? (ObjectId) foo : def;
    }
public ObjectId getObjectId(final String field, final ObjectId def) {
        Object foo = get(field);
        return (foo != null) ? (ObjectId) foo : def;
    }
public ObjectId getObjectId ( final String field , final ObjectId def ) { Object foo = get ( field ) ; return ( foo != null ) ? ( ObjectId ) foo : def ; }
Returns the object id or def if not set.

@param field The field to return
@param def   the default value in case the field is not found
@return The field object value or def if not set.
Returns the object id or def if not set .