/** * Tell the <code>StringKeyDirtyFlagMap</code> that it should * allow non-<code>Serializable</code> values. Enforces that the Map * doesn't already include transient data. * * @deprecated JDBCJobStores no longer prune out transient data. If you * include non-Serializable values in the Map, you will now get an * exception when attempting to store it in a database. */ public void setAllowsTransientData(boolean allowsTransientData) { if (containsTransientData() && !allowsTransientData) { throw new IllegalStateException( "Cannot set property 'allowsTransientData' to 'false' " + "when data map contains non-serializable objects."); } this.allowsTransientData = allowsTransientData; }
/** * <p> * Retrieve the identified <code>String</code> value from the <code>StringKeyDirtyFlagMap</code>. * </p> * * @throws ClassCastException * if the identified object is not a String. */ public String getString(String key) { Object obj = get(key); try { return (String) obj; } catch (Exception e) { throw new ClassCastException("Identified object is not a String."); } } }
/** * Removes any data values in the map that are non-Serializable. Does * nothing if this Map does not allow transient data. * * @deprecated JDBCJobStores no longer prune out transient data. If you * include non-Serializable values in the Map, you will now get an * exception when attempting to store it in a database. */ public void removeTransientData() { if (!getAllowsTransientData()) { // short circuit... return; } String[] keys = getKeys(); for (int i = 0; i < keys.length; i++) { Object o = super.get(keys[i]); if (!(o instanceof Serializable)) { remove(keys[i]); } } }
/** * Determine whether any values in this Map do not implement * <code>Serializable</code>. Always returns false if this Map * is flagged to not allow transient data. * * @deprecated JDBCJobStores no longer prune out transient data. If you * include non-Serializable values in the Map, you will now get an * exception when attempting to store it in a database. */ public boolean containsTransientData() { if (!getAllowsTransientData()) { // short circuit... return false; } String[] keys = getKeys(); for (int i = 0; i < keys.length; i++) { Object o = super.get(keys[i]); if (!(o instanceof Serializable)) { return true; } } return false; }
/** * <p> * Adds the given <code>float</code> value as a string version to the * <code>Job</code>'s data map. * </p> */ public void putAsString(String key, float value) { String strValue = Float.toString(value); super.put(key, strValue); }
@Override public int hashCode() { return getWrappedMap().hashCode(); }
/** * <p> * Adds the given <code>Long</code> value as a string version to the * <code>Job</code>'s data map. * </p> */ public void putAsString(String key, Long value) { String strValue = value.toString(); super.put(key, strValue); }
/** * Determine whether any values in this Map do not implement * <code>Serializable</code>. Always returns false if this Map * is flagged to not allow transient data. * * @deprecated JDBCJobStores no longer prune out transient data. If you * include non-Serializable values in the Map, you will now get an * exception when attempting to store it in a database. */ public boolean containsTransientData() { if (!getAllowsTransientData()) { // short circuit... return false; } String[] keys = getKeys(); for (int i = 0; i < keys.length; i++) { Object o = super.get(keys[i]); if (!(o instanceof Serializable)) { return true; } } return false; }
@Override public int hashCode() { return getWrappedMap().hashCode(); }
/** * <p> * Adds the given <code>double</code> value as a string version to the * <code>Job</code>'s data map. * </p> */ public void putAsString(String key, double value) { String strValue = Double.toString(value); super.put(key, strValue); }
/** * Removes any data values in the map that are non-Serializable. Does * nothing if this Map does not allow transient data. * * @deprecated JDBCJobStores no longer prune out transient data. If you * include non-Serializable values in the Map, you will now get an * exception when attempting to store it in a database. */ public void removeTransientData() { if (!getAllowsTransientData()) { // short circuit... return; } String[] keys = getKeys(); for (int i = 0; i < keys.length; i++) { Object o = super.get(keys[i]); if (!(o instanceof Serializable)) { remove(keys[i]); } } }
/** * <p> * Retrieve the identified <code>String</code> value from the <code>StringKeyDirtyFlagMap</code>. * </p> * * @throws ClassCastException * if the identified object is not a String. */ public String getString(String key) { Object obj = get(key); try { return (String) obj; } catch (Exception e) { throw new ClassCastException("Identified object is not a String."); } } }
/** * Determine whether any values in this Map do not implement * <code>Serializable</code>. Always returns false if this Map * is flagged to not allow transient data. * * @deprecated JDBCJobStores no longer prune out transient data. If you * include non-Serializable values in the Map, you will now get an * exception when attempting to store it in a database. */ public boolean containsTransientData() { if (!getAllowsTransientData()) { // short circuit... return false; } String[] keys = getKeys(); for (int i = 0; i < keys.length; i++) { Object o = super.get(keys[i]); if (!(o instanceof Serializable)) { return true; } } return false; }
/** * Tell the <code>StringKeyDirtyFlagMap</code> that it should * allow non-<code>Serializable</code> values. Enforces that the Map * doesn't already include transient data. * * @deprecated JDBCJobStores no longer prune out transient data. If you * include non-Serializable values in the Map, you will now get an * exception when attempting to store it in a database. */ public void setAllowsTransientData(boolean allowsTransientData) { if (containsTransientData() && !allowsTransientData) { throw new IllegalStateException( "Cannot set property 'allowsTransientData' to 'false' " + "when data map contains non-serializable objects."); } this.allowsTransientData = allowsTransientData; }
/** * <p> * Adds the given <code>Integer</code> value as a string version to the * <code>Job</code>'s data map. * </p> */ public void putAsString(String key, Integer value) { String strValue = value.toString(); super.put(key, strValue); }
/** * Removes any data values in the map that are non-Serializable. Does * nothing if this Map does not allow transient data. * * @deprecated JDBCJobStores no longer prune out transient data. If you * include non-Serializable values in the Map, you will now get an * exception when attempting to store it in a database. */ public void removeTransientData() { if (!getAllowsTransientData()) { // short circuit... return; } String[] keys = getKeys(); for (int i = 0; i < keys.length; i++) { Object o = super.get(keys[i]); if (!(o instanceof Serializable)) { remove(keys[i]); } } }
/** * <p> * Retrieve the identified <code>double</code> value from the <code>StringKeyDirtyFlagMap</code>. * </p> * * @throws ClassCastException * if the identified object is not a Double. */ public double getDouble(String key) { Object obj = get(key); try { if(obj instanceof Double) return ((Double) obj).doubleValue(); return Double.parseDouble((String)obj); } catch (Exception e) { throw new ClassCastException("Identified object is not a Double."); } }