APIProvider.java
1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.mumfrey.liteloader.api.manager;
import java.util.regex.Pattern;
import com.mumfrey.liteloader.api.LiteAPI;
/**
* Interface for the API Provider, which manages API instances and lifecycle
*
* @author Adam Mummery-Smith
*/
public interface APIProvider
{
public static final Pattern idAndRevisionPattern = Pattern.compile("^([^@]+)@([0-9]{1,5})$");
/**
* Get all available API instances in an array
*/
public abstract LiteAPI[] getAPIs();
/**
* Returns true if the specified API is available
*
* @param identifier API identifier (case sensitive) or API
* identifier-plus-minrevision in the form "identifier@minver"
*/
public abstract boolean isAPIAvailable(String identifier);
/**
* Returns true if the specified API is available
*
* @param identifier API identifier (case sensitive)
* @param minRevision minimum required revision
*/
public abstract boolean isAPIAvailable(String identifier, int minRevision);
/**
* Gets a specific API by identifier
*
* @param identifier API identifier (case sensitive)
*/
public abstract LiteAPI getAPI(String identifier);
/**
* Gets a specific API by class
*
* @param apiClass
*/
public abstract <T extends LiteAPI> T getAPI(Class<T> apiClass);
}