Simplified MongoPropertyDescriptor.isOfIdType().

This commit is contained in:
Oliver Gierke
2011-01-05 20:19:43 +01:00
parent cb6bed43ab
commit 5796611b8f

View File

@@ -130,10 +130,7 @@ public class MongoPropertyDescriptors implements Iterable<MongoPropertyDescripto
* @return
*/
public boolean isOfIdType() {
boolean isString = String.class.isAssignableFrom(getPropertyType());
boolean isObjectId = ObjectId.class.isAssignableFrom(getPropertyType());
boolean isBigInteger = BigInteger.class.isAssignableFrom(getPropertyType());
return isString || isObjectId || isBigInteger;
return SUPPORTED_ID_CLASSES.contains(delegate.getPropertyType());
}
/**