Package ml.karmaconfigs.api.common.karma
Class APISource
java.lang.Object
ml.karmaconfigs.api.common.karma.APISource
- All Implemented Interfaces:
Serializable,KarmaSource
Karma API source
- See Also:
- Serialized Form
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddProvider(KarmaSource src)Add a new karma source providerString[]authors()Karma source authorsstatic voiddefineDefault(KarmaSource def)Define the default source that KarmaAPI will use.Karma source descriptionstatic KarmaSourcegetOriginal(boolean forceKarma)Get the original karma sourcestatic booleanhasProvider(String name)Get if the API source has stored a source with the specified namestatic KarmaSourceloadProvider(String name)Load a providername()Karma source namestatic voidupdateProvider(String name, KarmaSource target)Update a source providerKarma source update URLversion()Karma source versionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ml.karmaconfigs.api.common.karma.KarmaSource
async, authors, console, getDataPath, getSourceFile, isSource, srcEquals, stopTasks, sync
-
Field Details
-
DEFAULT_SOURCE
Deprecated.Default source name
-
-
Method Details
-
addProvider
Add a new karma source provider- Parameters:
src- the karma source- Throws:
IllegalStateException- if the source is already added
-
updateProvider
Update a source provider- Parameters:
name- the original source nametarget- the new source- Throws:
IllegalStateException- if the new source replacement is not the same as the stored one
-
hasProvider
Get if the API source has stored a source with the specified name- Parameters:
name- the source name- Returns:
- if the API source has that source
-
loadProvider
Load a provider- Parameters:
name- the provider name- Returns:
- the karma source attached to that name
- Throws:
IllegalArgumentException- if the source is not registered
-
defineDefault
Define the default source that KarmaAPI will use. Differently fromstaticis that method throwserrorif there's already a default source set.- Parameters:
def- the default source- Throws:
SecurityException
-
getOriginal
Get the original karma source- Parameters:
forceKarma- force KarmaAPI provider- Returns:
- the original karma source
-
name
Karma source name- Specified by:
namein interfaceKarmaSource- Returns:
- the source name
-
version
Karma source version- Specified by:
versionin interfaceKarmaSource- Returns:
- the source version
-
description
Karma source description- Specified by:
descriptionin interfaceKarmaSource- Returns:
- the source description
-
authors
Karma source authors- Specified by:
authorsin interfaceKarmaSource- Returns:
- the source authors
-
updateURL
Karma source update URL- Specified by:
updateURLin interfaceKarmaSource- Returns:
- the source update URL
-