public SupportedProperty(SupportedProperty other) { super(); this.propertyId = other.getPropertyId(); this.valueRequired = other.isValueRequired(); this.value = other.getValue(); }
public static SupportedProperty from(String uri, boolean valueRequired) { return new SupportedProperty(uri, valueRequired); } }
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; }
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); }
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; }
public static SupportedProperty supportedDomainProperty(String rdfPropertyUri, boolean required) { return new SupportedProperty(rdfPropertyUri, required); } }
public List<SupportedProperty> supportedProperties( List<SupportedProperty> supportedProperties) { return supportedProperties.stream().map(s -> new SupportedProperty(s)).collect(Collectors.toList()); }