Package dev.morphia.mapping
Class DiscriminatorFunction
- java.lang.Object
-
- dev.morphia.mapping.DiscriminatorFunction
-
public abstract class DiscriminatorFunction extends Object
Defines a function to calculate a discriminator value. This function is only applied if the existing value is the annotation default value.
-
-
Constructor Summary
Constructors Constructor Description DiscriminatorFunction()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidapply(EntityModelBuilder builder)Applies the function to the given model to determine the discriminator valuestatic DiscriminatorFunctionclassName()Defines a function to use the class name for the discriminator valueprotected abstract Stringcompute(EntityModelBuilder builder)static DiscriminatorFunctionlowerClassName()Defines a function to use the lowercase class name for the discriminator valuestatic DiscriminatorFunctionlowerSimpleName()Defines a function to use the lowercase simple class name for the discriminator valuestatic DiscriminatorFunctionsimpleName()Defines a function to use the simple class name for the discriminator value
-
-
-
Method Detail
-
className
public static DiscriminatorFunction className()
Defines a function to use the class name for the discriminator value- Returns:
- the function
-
lowerClassName
public static DiscriminatorFunction lowerClassName()
Defines a function to use the lowercase class name for the discriminator value- Returns:
- the function
-
lowerSimpleName
public static DiscriminatorFunction lowerSimpleName()
Defines a function to use the lowercase simple class name for the discriminator value- Returns:
- the function
-
simpleName
public static DiscriminatorFunction simpleName()
Defines a function to use the simple class name for the discriminator value- Returns:
- the function
-
apply
public final void apply(EntityModelBuilder builder)
Applies the function to the given model to determine the discriminator value- Parameters:
builder- the builder to evaluate
-
compute
protected abstract String compute(EntityModelBuilder builder)
-
-