Revision: 3932
Author: [email protected]
Date: Fri Aug 27 15:04:23 2010
Log: Added a toString() method to DomainCategory to return the name of the
category. Also, shortened the areEqual method to use the
SQLPowerUtils.areEqual method.
http://code.google.com/p/power-architect/source/detail?r=3932
Modified:
/trunk/src/main/java/ca/sqlpower/architect/enterprise/DomainCategory.java
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/enterprise/DomainCategory.java
Tue Aug 3 12:49:13 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/enterprise/DomainCategory.java
Fri Aug 27 15:04:23 2010
@@ -30,6 +30,7 @@
import ca.sqlpower.object.annotation.Constructor;
import ca.sqlpower.object.annotation.ConstructorParameter;
import ca.sqlpower.sqlobject.UserDefinedSQLType;
+import ca.sqlpower.util.SQLPowerUtils;
/**
* {...@link UserDefinedSQLType}s can be organized into categories. For
example,
@@ -52,10 +53,7 @@
* category.
*/
public static boolean areEqual(@Nonnull DomainCategory cat1, @Nonnull
DomainCategory cat2) {
- if (cat1.getName() == null && cat2.getName() == null) return true;
- if (cat1.getName() != null &&
cat1.getName().equals(cat2.getName())) return true;
-
- return false;
+ return SQLPowerUtils.areEqual(cat1.getName(), cat2.getName());
}
/**
@@ -115,4 +113,9 @@
public void updateToMatch(DomainCategory matchMe) {
setName(matchMe.getName());
}
-}
+
+ @Override
+ public String toString() {
+ return getName();
+ }
+}