From b9380f348777ac62b12a0b0bf2990f2271f642d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 23 Nov 2010 10:52:39 +0100 Subject: [PATCH] Add method to set a configuration after creation time. --- src/main/java/net/pterodactylus/sone/core/Core.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 225e3e6..5563bf6 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -84,7 +84,7 @@ public class Core implements IdentityListener { private final CoreListenerManager coreListenerManager = new CoreListenerManager(this); /** The configuration. */ - private final Configuration configuration; + private Configuration configuration; /** The identity manager. */ private final IdentityManager identityManager; @@ -190,6 +190,18 @@ public class Core implements IdentityListener { // /** + * Sets the configuration to use. This will automatically save the current + * configuration to the given configuration. + * + * @param configuration + * The new configuration to use + */ + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + saveConfiguration(); + } + + /** * Returns the options used by the core. * * @return The options of the core -- 2.7.4