Search in sources :

Example 1 with PreconditionRuleBuilder

use of com.thinkbiganalytics.policy.rest.model.PreconditionRuleBuilder in project kylo by Teradata.

the class PreconditionAnnotationTransformer method buildUiModel.

@Override
public PreconditionRule buildUiModel(PreconditionPolicy annotation, Precondition policy, List<FieldRuleProperty> properties) {
    String desc = annotation.description();
    String shortDesc = annotation.shortDescription();
    if (StringUtils.isBlank(desc) && StringUtils.isNotBlank(shortDesc)) {
        desc = shortDesc;
    }
    if (StringUtils.isBlank(shortDesc) && StringUtils.isNotBlank(desc)) {
        shortDesc = desc;
    }
    PreconditionRule rule = new PreconditionRuleBuilder(annotation.name()).objectClassType(policy.getClass()).description(desc).shortDescription(shortDesc).addProperties(properties).build();
    return rule;
}
Also used : PreconditionRuleBuilder(com.thinkbiganalytics.policy.rest.model.PreconditionRuleBuilder) PreconditionRule(com.thinkbiganalytics.policy.rest.model.PreconditionRule)

Aggregations

PreconditionRule (com.thinkbiganalytics.policy.rest.model.PreconditionRule)1 PreconditionRuleBuilder (com.thinkbiganalytics.policy.rest.model.PreconditionRuleBuilder)1