Class Persistence


  • @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
    public final class Persistence
    extends Object
    Utility methods for persisting non-Describable classes.
    Since:
    TODO
    See Also:
    Saveable
    • Method Detail

      • getConfigFile

        @NonNull
        public static <T extends SaveableXmlFile 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 with BulkChange.
        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 returns null when the file doesn't exist.
        Throws:
        IOException