/
dRegistry.java
75 lines (60 loc) · 1.93 KB
/
dRegistry.java
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package net.aufdemrand.denizen.interfaces;
import java.util.Map;
/**
* Represents a Denizen Instance Registry for the various extensible parts,
* including Commands, Requirements, and Activities.
*
* @author Jeremy Schroeder
*
*/
public interface dRegistry {
/**
* Called by an AbstractInstance to get added to the registry.
*
* @param registrationName
* The name to use in the registry
* @param commandInstance
* A cast (AbstractInstance) of the instance being registered. Usually '(AbstractInstance) this'.
*
* @return false if an exception has been thrown.
*
*/
public boolean register(String registrationName, RegistrationableInstance commandInstance);
/**
* Returns a Map of the instances added by the register() method keyed by the registration name.
*
* @return the entire registry.
*
*/
public Map<String, ? extends RegistrationableInstance> list();
/**
* Gets a specific instance of AbstractInstance that has been previously registered.
*
* @param clazz
* class of the requested AbstractInstance.
*
* @return the instance of the class specified.
*
*/
public <T extends RegistrationableInstance> T get(Class<T> clazz);
/**
* Gets a specific instance of AbstractInstance that has been previously registered.
*
* @param instanceKey
* string key in which the AbstractInstance was registered with.
*
* @return the instance of the key specified.
*
*/
public RegistrationableInstance get(String instanceKey);
/**
* Generic method for registering the core classes of this registry's type
*
*/
public void registerCoreMembers();
/**
* Calls an onDisable method on all registered instances.
*
*/
public void disableCoreMembers();
}