LibJF/libjf-config-legacy-shim/src/main/java/io/gitlab/jfronny/libjf/config/api/EntryInfo.java

71 lines
1.6 KiB
Java

package io.gitlab.jfronny.libjf.config.api;
import io.gitlab.jfronny.gson.JsonElement;
import io.gitlab.jfronny.gson.stream.JsonWriter;
import java.io.IOException;
@Deprecated
public interface EntryInfo<T> {
/**
* @return Get the default value of this entry
*/
T getDefault();
/**
* Gets the current value
* @return The current value
*/
T getValue() throws IllegalAccessException;
/**
* Set the current value to the parameter
* @param value The value to use
*/
void setValue(T value) throws IllegalAccessException;
/**
* Get the value type of this entry. Will use the class definition, not the current value
* @return The type of this entry
*/
Class<T> getValueType();
/**
* Ensure the current value is within expected bounds.
*/
void fix();
/**
* Get the name of this entry
* @return This entry's name
*/
String getName();
/**
* Set this entry's value to that of the element
* @param element The element to read from
*/
void loadFromJson(JsonElement element) throws IllegalAccessException;
/**
* Write the currently cached value to the writer
* @param writer The writer to write to
*/
void writeTo(JsonWriter writer, String translationPrefix) throws IOException, IllegalAccessException;
/**
* @return Get the width for this entry
*/
int getWidth();
/**
* @return Get the minimum value of this entry
*/
double getMinValue();
/**
* @return Get the maximum value for this entry
*/
double getMaxValue();
}