This commit is contained in:
baifuyu 2023-12-18 15:58:46 +08:00
parent 4621cdace5
commit 0ee673d9f6
7 changed files with 8 additions and 23 deletions

View File

@ -3,12 +3,12 @@ package com.antgroup.openspg.builder.core.property;
import com.antgroup.openspg.builder.core.property.impl.PropertyIdEqualsNormalizer;
import com.antgroup.openspg.builder.core.property.impl.PropertyOperatorNormalizer;
import com.antgroup.openspg.builder.model.pipeline.config.OperatorPropertyNormalizerConfig;
import com.antgroup.openspg.builder.model.pipeline.config.PropertyNormalizerConfig;
import com.antgroup.openspg.builder.model.pipeline.config.BasePropertyNormalizerConfig;
import com.antgroup.openspg.builder.model.pipeline.enums.PropertyNormalizerTypeEnum;
public class PropertyNormalizerFactory {
public static PropertyNormalizer getPropertyNormalizer(PropertyNormalizerConfig config) {
public static PropertyNormalizer getPropertyNormalizer(BasePropertyNormalizerConfig config) {
PropertyNormalizerTypeEnum normalizerType = config.getNormalizerType();
switch (normalizerType) {
case OPERATOR:

View File

@ -35,7 +35,7 @@ public class BuilderJsonUtils {
.recognizeSubtypes())
.registerTypeAdapterFactory(
RuntimeTypeAdapterFactory.of(
PropertyNormalizerConfig.class, DEFAULT_TYPE_FIELD_NAME)
BasePropertyNormalizerConfig.class, DEFAULT_TYPE_FIELD_NAME)
.registerSubtype(
OperatorPropertyNormalizerConfig.class,
PropertyNormalizerTypeEnum.OPERATOR.name())

View File

@ -24,7 +24,7 @@ public abstract class BaseMappingNodeConfig extends BaseNodeConfig {
public static class MappingConfig {
private final String source;
private final String target;
private final PropertyNormalizerConfig normalizerConfig;
private final BasePropertyNormalizerConfig normalizerConfig;
}
public abstract List<BaseSPGIdentifier> getIdentifiers();

View File

@ -1,15 +0,0 @@
package com.antgroup.openspg.builder.model.pipeline.config;
import com.antgroup.openspg.builder.model.pipeline.enums.PropertyNormalizerTypeEnum;
import lombok.Getter;
@Getter
public abstract class BasePropertyMounterConfig {
/** the type of property mounter */
private final PropertyNormalizerTypeEnum type;
protected BasePropertyMounterConfig(PropertyNormalizerTypeEnum type) {
this.type = type;
}
}

View File

@ -5,11 +5,11 @@ import com.antgroup.openspg.server.common.model.base.BaseValObj;
import lombok.Getter;
@Getter
public abstract class PropertyNormalizerConfig extends BaseValObj {
public abstract class BasePropertyNormalizerConfig extends BaseValObj {
private final PropertyNormalizerTypeEnum normalizerType;
public PropertyNormalizerConfig(PropertyNormalizerTypeEnum normalizerType) {
public BasePropertyNormalizerConfig(PropertyNormalizerTypeEnum normalizerType) {
this.normalizerType = normalizerType;
}
}

View File

@ -2,7 +2,7 @@ package com.antgroup.openspg.builder.model.pipeline.config;
import com.antgroup.openspg.builder.model.pipeline.enums.PropertyNormalizerTypeEnum;
public class IdEqualsPropertyNormalizerConfig extends PropertyNormalizerConfig {
public class IdEqualsPropertyNormalizerConfig extends BasePropertyNormalizerConfig {
public IdEqualsPropertyNormalizerConfig() {
super(PropertyNormalizerTypeEnum.ID_EQUALS);

View File

@ -4,7 +4,7 @@ import com.antgroup.openspg.builder.model.pipeline.enums.PropertyNormalizerTypeE
import lombok.Getter;
@Getter
public class OperatorPropertyNormalizerConfig extends PropertyNormalizerConfig {
public class OperatorPropertyNormalizerConfig extends BasePropertyNormalizerConfig {
private final OperatorConfig operatorConfig;