Commits

Anonymous committed 6285d36

add more convenience methods.
CVS: ----------------------------------------------------------------------
CVS: Issue number:
CVS: If this change addresses one or more issues,
CVS: then enter the issue number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to the project by someone else; i.e.,
CVS: they sent us a patch or a set of diffs, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.

git-svn-id: http://svn.opensymphony.com/svn/quartz/trunk@26269f7d36a-ea1c-0410-88ea-9fd03e4c9665

Comments (0)

Files changed (1)

src/java/org/quartz/JobDataMap.java

      * </p>
      * 
      * @throws ClassCastException
+     *           if the identified object is not a String or Integeger.
+     */
+    public long getIntValue(String key) {
+        Object obj = get(key);
+
+        if(obj instanceof String)
+            return getIntFromString(key);
+        else
+            return getIntValue(key);
+    }
+    
+    /**
+     * <p>
+     * Retrieve the identified <code>int</code> value from the <code>JobDataMap</code>.
+     * </p>
+     * 
+     * @throws ClassCastException
      *           if the identified object is not a String.
      */
     public Integer getIntegerFromString(String key) {
 
     /**
      * <p>
+     * Retrieve the identified <code>boolean</code> value from the 
+     * <code>JobDataMap</code>.
+     * </p>
+     * 
+     * @throws ClassCastException
+     *           if the identified object is not a String or Boolean.
+     */
+    public boolean getBooleanValue(String key) {
+        Object obj = get(key);
+
+        if(obj instanceof String)
+            return getBooleanValueFromString(key);
+        else
+            return getBoolean(key);
+    }
+
+    /**
+     * <p>
      * Retrieve the identified <code>Boolean</code> value from the <code>JobDataMap</code>.
      * </p>
      * 
 
     /**
      * <p>
+     * Retrieve the identified <code>double</code> value from the <code>JobDataMap</code>.
+     * </p>
+     * 
+     * @throws ClassCastException
+     *           if the identified object is not a String or Double.
+     */
+    public double getDoubleValue(String key) {
+        Object obj = get(key);
+
+        if(obj instanceof String)
+            return getDoubleValueFromString(key);
+        else
+            return getDouble(key);
+    }
+
+    /**
+     * <p>
      * Retrieve the identified <code>Double</code> value from the <code>JobDataMap</code>.
      * </p>
      * 
 
     /**
      * <p>
+     * Retrieve the identified <code>float</code> value from the <code>JobDataMap</code>.
+     * </p>
+     * 
+     * @throws ClassCastException
+     *           if the identified object is not a String or Float.
+     */
+    public float getFloatValue(String key) {
+        Object obj = get(key);
+
+        if(obj instanceof String)
+            return getFloatValueFromString(key);
+        else
+            return getFloatValue(key);
+    }
+    
+    /**
+     * <p>
      * Retrieve the identified <code>Float</code> value from the <code>JobDataMap</code>.
      * </p>
      * 
 
     /**
      * <p>
+     * Retrieve the identified <code>long</code> value from the <code>JobDataMap</code>.
+     * </p>
+     * 
+     * @throws ClassCastException
+     *           if the identified object is not a String or Long.
+     */
+    public long getLongValue(String key) {
+        Object obj = get(key);
+
+        if(obj instanceof String)
+            return getLongValueFromString(key);
+        else
+            return getLongValue(key);
+    }
+    
+    /**
+     * <p>
      * Retrieve the identified <code>Long</code> value from the <code>JobDataMap</code>.
      * </p>
      * 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.