61 lines
1.2 KiB
Java
61 lines
1.2 KiB
Java
package org.warp.jcwdb;
|
|
|
|
import java.io.IOException;
|
|
import java.util.function.BiConsumer;
|
|
import java.util.function.BiFunction;
|
|
import java.util.function.Consumer;
|
|
import java.util.function.Function;
|
|
|
|
public interface Editable<T> {
|
|
/**
|
|
* Reccomended way to edit the value
|
|
*
|
|
* @param editFunction
|
|
* @throws IOException
|
|
*/
|
|
void editValue(BiFunction<T, Saveable, T> editFunction);
|
|
|
|
/**
|
|
* Reccomended way to edit the value
|
|
* @param editFunction
|
|
* @throws IOException
|
|
*/
|
|
void editValue(Function<T, T> editFunction);
|
|
|
|
/**
|
|
* Reccomended way to edit the value
|
|
* @param editFunction
|
|
* @throws IOException
|
|
*/
|
|
void editValue(BiConsumer<T, Saveable> editFunction);
|
|
|
|
/**
|
|
* Reccomended way to edit the value
|
|
* @param editFunction
|
|
* @throws IOException
|
|
*/
|
|
void editValue(Consumer<T> editFunction);
|
|
|
|
/**
|
|
* Reccomended way to view the value
|
|
* @param viewFunction
|
|
* @throws IOException
|
|
*/
|
|
void viewValue(Consumer<T> viewFunction);
|
|
|
|
/**
|
|
* Substitute the old value with a new one
|
|
* @param val
|
|
* @throws IOException
|
|
*/
|
|
void setValue(T val);
|
|
|
|
|
|
/**
|
|
* DO NOT ATTEMPT TO MODIFY THE VALUE RETURNED
|
|
* @return
|
|
*/
|
|
T getValueReadOnlyUnsafe();
|
|
|
|
}
|