Author: [log in to unmask]
Date: Thu Feb 19 15:22:05 2015
New Revision: 2169
Log:
Add method for checking if a given conditions name exists.
Modified:
java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java
Modified: java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java
=============================================================================
--- java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java (original)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/database/DatabaseConditionsManager.java Thu Feb 19 15:22:05 2015
@@ -580,7 +580,7 @@
/**
* Find a collection of conditions validity records by key name. The key
* name is distinct from the table name, but they are usually set to the
- * same value in the XML configuration.
+ * same value.
* @param name The conditions key name.
* @return The set of matching conditions records.
*/
@@ -603,6 +603,15 @@
}
}
return foundConditionsRecords;
+ }
+
+ /**
+ * True if there is a conditions record with the given name.
+ * @param name The conditions name.
+ * @return True if a conditions record exists with the given name.
+ */
+ public boolean hasConditionsRecord(String name) {
+ return !findConditionsRecords(name).isEmpty();
}
/**
|