Sometimes you are trying to apply a model to something that is not an entity, or you want something that is a bit more
complex than the default Dummy
. You can wrap your custom target with BaseEntity
class.
public class CustomBaseEntity implements BaseEntity<CustomTarget> {
@Getter private final CustomTarget original;
public CustomBaseEntity(CustomTarget original) {
this.original = original;
}
// Implement the rest of the methods
}
When it is time to add models to this custom target, we can do something similar to the Dummy
method.
CustomBaseEntity baseEntity = new CustomBaseEntity(customTarget);
ModeledEntity modeledEntity = ModelEngineAPI.createModeledEntity(baseEntity);
// The rest is exactly the same