public class Mixing extends Object implements sirius.kernel.di.Initializable
descriptor for an entity.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_REALM
Contains the name of the default realm.
|
static sirius.kernel.health.Log |
LOG |
| Constructor and Description |
|---|
Mixing() |
| Modifier and Type | Method and Description |
|---|---|
Optional<EntityDescriptor> |
findDescriptor(String aTypeName)
Returns the descriptor for the given entity type.
|
Collection<EntityDescriptor> |
getDesciptors()
Returns all known descriptors.
|
EntityDescriptor |
getDescriptor(Class<?> aClass)
Returns the descriptor of the given entity class.
|
EntityDescriptor |
getDescriptor(String aTypeName)
Returns the descriptor for the given entity type.
|
String |
getNameForType(Class<?> type)
Each entity type can be addressed by its class or by a unique name, which is its simple class name in upper
case.
|
String |
getUniqueName(Class<?> type,
Object id)
Computes the unique name of an entity based on its type and id.
|
String |
getUniqueName(String typeName,
Object id)
Computes the unique name of an entity based on its descriptor type and id.
|
void |
initialize() |
static sirius.kernel.commons.Tuple<String,String> |
splitUniqueName(String uniqueName)
Splits a unique name into the descriptor type and id.
|
public static final String DEFAULT_REALM
public static final sirius.kernel.health.Log LOG
public void initialize()
throws Exception
initialize in interface sirius.kernel.di.InitializableException@Nonnull public String getNameForType(@Nonnull Class<?> type)
type - the entity class to generate the type name for@Nonnull public String getUniqueName(@Nonnull String typeName, Object id)
typeName - the name of the entity typeid - the id of the entity@Nonnull public String getUniqueName(@Nonnull Class<?> type, Object id)
type - the entity class to generate the type name forid - the id of the entity@Nonnull public static sirius.kernel.commons.Tuple<String,String> splitUniqueName(@Nullable String uniqueName)
uniqueName - the unique name of an entity.getUniqueName(String, Object)public EntityDescriptor getDescriptor(Class<?> aClass)
aClass - the entity classpublic EntityDescriptor getDescriptor(String aTypeName)
aTypeName - a getNameForType(Class) of an entitysirius.kernel.health.HandledException - if no matching descriptor existspublic Optional<EntityDescriptor> findDescriptor(String aTypeName)
aTypeName - a getNameForType(Class) of an entitypublic Collection<EntityDescriptor> getDesciptors()
Copyright © 2018. All rights reserved.