public <V> V supportedOntologyPropertyValue(String domainPropertyInternalId, String propertyId, Class<V> targetClass) { DomainStaticProperty dsp = getStaticPropertyByName(domainPropertyInternalId, DomainStaticProperty.class); return typeParser.parse(dsp .getSupportedProperties() .stream() .filter(sp -> sp.getPropertyId().equals(propertyId)) .findFirst() .map(SupportedProperty::getValue) .get(), targetClass); }
public SupportedProperty(SupportedProperty other) { super(); this.propertyId = other.getPropertyId(); this.valueRequired = other.isValueRequired(); this.value = other.getValue(); }
private DataSinkInvocation updateKafkaSec(DataSinkInvocation actionClient, PipelineModificationMessage message) { List<StaticProperty> properties = message.getPipelineModifications().get(0).getStaticProperties(); List<StaticProperty> newStaticProperties = new ArrayList<>(); for (StaticProperty p : properties) { if (p instanceof FreeTextStaticProperty ||p instanceof DomainStaticProperty) { if (p instanceof FreeTextStaticProperty) { if (p.getInternalName().equals("topic")) ((FreeTextStaticProperty) p).setValue(outputTopic); } else if (p instanceof DomainStaticProperty) { for(SupportedProperty sp : ((DomainStaticProperty) p).getSupportedProperties()) { if (sp.getPropertyId().equals("http://schema.org/kafkaHost")) sp.setValue(String .valueOf(BackendConfig.INSTANCE.getKafkaHost())); else if (sp.getPropertyId().equals("http://schema.org/kafkaPort")) sp.setValue(String .valueOf(BackendConfig.INSTANCE.getKafkaPort())); } } } newStaticProperties.add(p); } actionClient.setStaticProperties(newStaticProperties); return actionClient; }
private DataSinkInvocation updateKafkaSec(DataSinkInvocation actionClient, PipelineModificationMessage message) { List<StaticProperty> properties = message.getPipelineModifications().get(0).getStaticProperties(); List<StaticProperty> newStaticProperties = new ArrayList<>(); for (StaticProperty p : properties) { if (p instanceof FreeTextStaticProperty ||p instanceof DomainStaticProperty) { if (p instanceof FreeTextStaticProperty) { if (p.getInternalName().equals("topic")) ((FreeTextStaticProperty) p).setValue(outputTopic); } else if (p instanceof DomainStaticProperty) { for(SupportedProperty sp : ((DomainStaticProperty) p).getSupportedProperties()) { if (sp.getPropertyId().equals("http://schema.org/kafkaHost")) sp.setValue(String .valueOf(BackendConfig.INSTANCE.getKafkaHost())); else if (sp.getPropertyId().equals("http://schema.org/kafkaPort")) sp.setValue(String .valueOf(BackendConfig.INSTANCE.getKafkaPort())); } } } newStaticProperties.add(p); } actionClient.setStaticProperties(newStaticProperties); return actionClient; }