/** * Adds an object to this relation. * * @param object The object to add to this relation. */ public void add(T object) { if (object == null) throw new IllegalArgumentException("null AVObject"); if (AVUtils.isBlankString(targetClass)) { targetClass = object.getClassName(); } if (!AVUtils.isBlankString(targetClass) && !targetClass.equals(object.getClassName())) { throw new IllegalArgumentException("Could not add class '" + object.getClassName() + "' to this relation,expect class is '" + targetClass + "'"); } parent.addRelation(object, key, true); }
/** * Adds an object to this relation. * * @param object The object to add to this relation. */ public void add(T object) { if (object == null) throw new IllegalArgumentException("null AVObject"); if (AVUtils.isBlankString(targetClass)) { targetClass = object.getClassName(); } if (!AVUtils.isBlankString(targetClass) && !targetClass.equals(object.getClassName())) { throw new IllegalArgumentException("Could not add class '" + object.getClassName() + "' to this relation,expect class is '" + targetClass + "'"); } parent.addRelation(object, key, true); }