Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Mark saveValue and loadValue deprecated
ModuleItem#saveValue and ModuleItem#loadValue are now deprecated in
favor of ModuleService methods, which can be called from a Contextual
environment and thus use the new PrefService API.
  • Loading branch information
hinerm committed Jul 25, 2014
commit cc97d1bc05155913b4bc8860f69b17b47c0b651c
2 changes: 2 additions & 0 deletions src/main/java/org/scijava/module/AbstractModuleItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public String getPersistKey() {
* value for null.
*/
@Override
@Deprecated
public T loadValue() {
// if there is nothing to load from persistence return nothing
if (!isPersisted()) return null;
Expand All @@ -157,6 +158,7 @@ public T loadValue() {
}

@Override
@Deprecated
public void saveValue(final T value) {
if (!isPersisted()) return;

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/scijava/module/ModuleItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,21 @@ public interface ModuleItem<T> extends BasicDetails {
* Note that this is different than obtaining a module instance's current
* value for the input; see {@link #getValue(Module)} for that.
* </p>
*
* @deprecated
* @see ModuleService#load(ModuleItem)
*/
@Deprecated
T loadValue();

/**
* Saves the given value to persistent storage. This allows later restoration
* of the value via {@link #loadValue()}, even from a different JVM.
*
* @deprecated
* @see ModuleService#save(ModuleItem, Object)
*/
@Deprecated
void saveValue(T value);

/** Gets the function that is called to initialize the item's value. */
Expand Down