public interface ClassKeyed<T extends Enum<T> & ClassKeyed<T>>
Internal API. Do not use it from application or plugin code. It is public only because the datastore modules that share it are separate artifacts, and Java cannot restrict a type to a set of artifacts. It is not part of the supported Grails API: it carries no compatibility promise, and it can change or be removed in any release, including a patch release, without a deprecation period. A class you write against it can stop compiling on the next upgrade.
An enum whose constants each stand for one thing that is told apart by the class of an object, such as the database a driver or a dialect object is for. A constant lists the classes it is for; the one listing java.lang.Object is the default, chosen for an object no other constant lists; a constant listing none is never chosen for an object. The constants are tried in their declared order, so a constant for a subclass is declared before the constant for its superclass.
This type knows nothing about any database. What a constant stands for, and the properties it carries, belong to the module that declares the enum: a SQL module declares which databases it supports, and a module for a store that is not SQL declares its own, and neither sees the other's.
T - the enum| Type Params | Return Type | Name and description |
|---|---|---|
<T extends Enum<T> & ClassKeyed<T>> |
public static T |
forInstance(java.lang.Class<T> type, java.lang.Object instance)Returns the constant of the enum for the object: the first whose classes the object is an instance of, or else the first listing java.lang.Object itself. |
|
public java.lang.Class<?>[] |
keyClasses()The classes the constant is for: any of their instances is told apart as this constant. |
Returns the constant of the enum for the object: the first whose classes the object is an instance of, or else the first listing java.lang.Object itself.
The classes the constant is for: any of their instances is told apart as this constant.