Class Persistence
- java.lang.Object
-
- com.cloudbees.jenkins.support.util.Persistence
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Saveable>
XmlFilegetConfigFile(Class<T> clazz)
static <T extends Saveable>
Tload(Class<T> clazz)
Loads a Saveable object from its default location or returnsnull
when the file doesn't exist.static <T extends Saveable>
voidsave(T object)
Saves a Saveable object to its default location.
-
-
-
Method Detail
-
getConfigFile
@NonNull public static <T extends Saveable> XmlFile getConfigFile(@NonNull Class<T> clazz)
- Returns:
- the default config file for the given class
-
save
public static <T extends Saveable> void save(@NonNull T object) throws IOException
Saves a Saveable object to its default location. This collaborates withBulkChange
.- Throws:
IOException
-
load
@CheckForNull public static <T extends Saveable> T load(@NonNull Class<T> clazz) throws IOException
Loads a Saveable object from its default location or returnsnull
when the file doesn't exist.- Throws:
IOException
-
-