You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2024/07/13 05:41:08 UTC
(streampipes) branch dev updated: refactor(#3023): Remove deprecated API that does not use the Label class (#3024)
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 289f8a4e47 refactor(#3023): Remove deprecated API that does not use the Label class (#3024)
289f8a4e47 is described below
commit 289f8a4e47e5c7183d475ef1ce2fb2993efd3958
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Sat Jul 13 07:41:03 2024 +0200
refactor(#3023): Remove deprecated API that does not use the Label class (#3024)
---
...AbstractConfigurablePipelineElementBuilder.java | 272 +--------------------
.../builder/AbstractProcessingElementBuilder.java | 69 ------
2 files changed, 3 insertions(+), 338 deletions(-)
diff --git a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractConfigurablePipelineElementBuilder.java b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractConfigurablePipelineElementBuilder.java
index 2a700eb780..7fb38563ee 100644
--- a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractConfigurablePipelineElementBuilder.java
+++ b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractConfigurablePipelineElementBuilder.java
@@ -84,23 +84,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
- /**
- * @deprecated use {@link #requiredTextParameter(Label)}
- * @param internalId
- * @param label
- * @param description
- * @return
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredTextParameter(String internalId, String label, String description) {
- this.staticProperties.add(prepareFreeTextStaticProperty(internalId,
- label,
- description,
- XSD.STRING.toString()));
-
- return me();
- }
-
/**
* Assigns a new secret text-based configuration parameter (e.g., a password) which is required
* by the processing element.
@@ -249,28 +232,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
- /**
- * @deprecated Use {@link #requiredTextParameterWithLink(Label, String)}
- *
- * @param internalId
- * @param label
- * @param description
- * @param linkedMappingPropertyInternalName
- * @return this
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredTextParameter(String internalId, String label, String description, String
- linkedMappingPropertyInternalName) {
- FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(internalId,
- label,
- description,
- XSD.STRING.toString());
-
- fsp.setMapsTo(linkedMappingPropertyInternalName);
- this.staticProperties.add(fsp);
- return me();
- }
-
/**
* Defines a text-based configuration parameter provided by pipeline developers at pipeline authoring time. The
* value range of the parameter is restricted to the value specification of a selected input event property.
@@ -380,25 +341,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
-
- /**
- * @deprecated Use {@link #requiredIntegerParameter(Label)} instead
- *
- * @param internalId
- * @param label
- * @param description
- * @return
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredIntegerParameter(String internalId, String label, String description) {
- this.staticProperties.add(prepareFreeTextStaticProperty(internalId,
- label,
- description,
- XSD.INTEGER.toString()));
-
- return me();
- }
-
/**
* Assigns a new number-based configuration parameter (an integer) which is required by the pipeline
* element.
@@ -413,28 +355,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
- /**
- * @deprecated use {@link #requiredIntegerParameter(Label, String)} instead
- *
- * @param internalId
- * @param label
- * @param description
- * @param linkedMappingPropertyInternalName
- * @return
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredIntegerParameter(String internalId, String label, String description, String
- linkedMappingPropertyInternalName) {
- FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(internalId,
- label,
- description,
- XSD.INTEGER.toString());
-
- fsp.setMapsTo(linkedMappingPropertyInternalName);
- this.staticProperties.add(fsp);
- return me();
- }
-
/**
* Defines a number-based configuration parameter of type integer provided by pipeline developers at pipeline
* authoring time. The
@@ -455,28 +375,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
-
- /**
- * @deprecated Use {@link #requiredIntegerParameter(Label, Integer)} instead
- *
- * @param internalId
- * @param label
- * @param description
- * @param defaultValue
- * @return
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredIntegerParameter(String internalId, String label, String description,
- Integer defaultValue) {
- FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(internalId,
- label,
- description,
- XSD.INTEGER.toString());
- fsp.setValue(String.valueOf(defaultValue));
- this.staticProperties.add(fsp);
- return me();
- }
-
/**
* Defines a number-based configuration parameter of type integer provided by pipeline developers at pipeline
* authoring time and initializes the parameter with a default value.
@@ -513,24 +411,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
- /**
- * @deprecated Use {@link #requiredFloatParameter(Label)} instead.
- * @param internalId
- * @param label
- * @param description
- * @return
- *
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredFloatParameter(String internalId, String label, String description) {
- this.staticProperties.add(prepareFreeTextStaticProperty(internalId,
- label,
- description,
- XSD.DOUBLE.toString()));
-
- return me();
- }
-
/**
* Assigns a new number-based configuration parameter (a float) which is required by the pipeline
* element.
@@ -546,33 +426,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
- /**
- * @deprecated use {@link #requiredFloatParameter(Label, String)}
- *
- * Defines a number-based configuration parameter of type float provided by pipeline developers at pipeline
- * authoring time. The
- * value range of the parameter is restricted to the value specification of a selected input event property.
- *
- * @param label The {@link org.apache.streampipes.sdk.helpers.Label}
- * that describes why this parameter is needed in a user-friendly manner.
- * @param linkedMappingPropertyInternalName The inernalId of the
- * {@link org.apache.streampipes.model.staticproperty.MappingProperty}
- * @return this
- *
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredFloatParameter(String internalId, String label, String description, String
- linkedMappingPropertyInternalName) {
- FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(internalId,
- label,
- description,
- XSD.DOUBLE.toString());
-
- fsp.setMapsTo(linkedMappingPropertyInternalName);
- this.staticProperties.add(fsp);
- return me();
- }
-
/**
* Defines a number-based configuration parameter of type float provided by pipeline developers at pipeline
* authoring time. The
@@ -593,28 +446,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
- /**
- * @deprecated Use {@link #requiredFloatParameter(Label, Float)} instead.
- *
- * @param internalId
- * @param label
- * @param description
- * @param defaultValue
- * @return this
- *
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredFloatParameter(String internalId, String label, String description, Float
- defaultValue) {
- FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(internalId,
- label,
- description,
- XSD.DOUBLE.toString());
- fsp.setValue(String.valueOf(defaultValue));
- this.staticProperties.add(fsp);
- return me();
- }
-
/**
* Defines a number-based configuration parameter of type float provided by preprocessing developers at preprocessing
* authoring time and initializes the parameter with a default value.
@@ -632,33 +463,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
- /**
- * @deprecated Use {@link #requiredFloatParameter(Label, Float, Float, Float)} instead.
- * Defines a number-based configuration parameter of type float provided by preprocessing developers at preprocessing
- * authoring time. In addition, an allowed value range of the expected input can be assigned.
- *
- * @param label The {@link org.apache.streampipes.sdk.helpers.Label} that describes why this parameter is needed in a
- * user-friendly manner.
- * @param min The minimum value of the allowed value range.
- * @param max The maximum value of the allowed value range.
- * @param step The granularity
- * @return this
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredFloatParameter(String internalId, String label, String description, Float min, Float max,
- Float step) {
- FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(internalId,
- label,
- description,
- XSD.DOUBLE.toString());
-
- PropertyValueSpecification valueSpecification = new PropertyValueSpecification(min, max, step);
- fsp.setValueSpecification(valueSpecification);
- this.staticProperties.add(fsp);
-
- return me();
- }
-
/**
* Defines a number-based configuration parameter of type float provided by preprocessing developers at preprocessing
* authoring time. In addition, an allowed value range of the expected input can be assigned.
@@ -701,21 +505,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
- /**
- * @deprecated Use {@link #requiredSingleValueSelection(Label, Option...)} instead.
- *
- * @param options An arbitrary number of {@link org.apache.streampipes.model.staticproperty.Option} elements. Use
- * {@link org.apache.streampipes.sdk.helpers.Options} to create option elements from string values.
- * @return this
- *
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredSingleValueSelection(String internalId, String label, String description,
- Option... options) {
- return requiredSingleValueSelection(internalId, label, description, Arrays.asList(options));
- }
-
-
/**
* Defines a configuration parameter that lets preprocessing developers
* select from a list of pre-defined configuration options.
@@ -729,29 +518,7 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
*/
public K requiredSingleValueSelection(Label label,
Option... options) {
- return requiredSingleValueSelection(label.getInternalId(), label.getLabel(), label.getDescription(),
- Arrays.asList(options));
- }
-
- /**
- * @deprecated Use {@link #requiredSingleValueSelection(Label, List)} instead.
- *
- * @param internalId
- * @param label
- * @param description
- * @param options
- * @return
- *
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredSingleValueSelection(String internalId, String label, String description,
- List<Option> options) {
- OneOfStaticProperty osp = new OneOfStaticProperty(internalId, label, description);
- osp.setOptions(options);
-
- this.staticProperties.add(osp);
- return me();
-
+ return requiredSingleValueSelection(label, Arrays.asList(options));
}
/**
@@ -798,23 +565,6 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
return me();
}
-
- /**
- * @deprecated Use {@link #requiredMultiValueSelection(Label, Option...)} instead.
- *
- * @param internalId
- * @param label
- * @param description
- * @param options
- * @return
- *
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredMultiValueSelection(String internalId, String label, String description,
- Option... options) {
- return requiredMultiValueSelection(internalId, label, description, Arrays.asList(options));
- }
-
/**
* Defines a configuration parameter that lets preprocessing developers
* select from a list of pre-defined configuration options, but multiple selections are allowed.
@@ -828,25 +578,9 @@ public abstract class AbstractConfigurablePipelineElementBuilder<K extends
*/
public K requiredMultiValueSelection(Label label,
Option... options) {
- return requiredMultiValueSelection(label.getInternalId(), label.getLabel(), label.getDescription(),
- Arrays.asList(options));
- }
- /**
- * @deprecated Use {@link #requiredMultiValueSelection(Label, List)} instead.
- *
- * @param internalId
- * @param label
- * @param description
- * @param options
- * @return
- *
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K requiredMultiValueSelection(String internalId, String label, String description,
- List<Option> options) {
- AnyStaticProperty asp = new AnyStaticProperty(internalId, label, description);
- asp.setOptions(options);
+ AnyStaticProperty asp = new AnyStaticProperty(label.getInternalId(), label.getLabel(), label.getDescription());
+ asp.setOptions(Arrays.asList(options));
this.staticProperties.add(asp);
return me();
diff --git a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractProcessingElementBuilder.java b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractProcessingElementBuilder.java
index 8db25a0578..d99618eec1 100644
--- a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractProcessingElementBuilder.java
+++ b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractProcessingElementBuilder.java
@@ -105,21 +105,6 @@ public abstract class AbstractProcessingElementBuilder<K extends
PropertySelectorConstants.SECOND_REQUIREMENT_PREFIX;
}
- /**
- * @deprecated Use {@link #naryMappingPropertyWithoutRequirement(Label, PropertyScope)} instead.
- * @param internalName
- * @param label
- * @param description
- * @return
- *
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K naryMappingPropertyWithoutRequirement(String internalName, String label, String
- description) {
- this.staticProperties.add(new MappingPropertyNary(internalName, label, description));
- return me();
- }
-
/**
* Adds a new {@link org.apache.streampipes.model.staticproperty.MappingPropertyNary}
* to the pipeline element definition which is not linked to a specific input property.
@@ -138,42 +123,6 @@ public abstract class AbstractProcessingElementBuilder<K extends
return me();
}
- /**
- * @deprecated Use {@link #unaryMappingPropertyWithoutRequirement(Label)} instead.
- * Use this method if you want to present users a single-value selection of all available input
- * event properties.
- *
- * Adds a new {@link org.apache.streampipes.model.staticproperty.MappingPropertyUnary}
- * to the pipeline element definition which is not linked to a specific input property.
- *
- * @param label A human-readable label
- * @return this
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K unaryMappingPropertyWithoutRequirement(String internalName, String label, String
- description) {
- this.staticProperties.add(new MappingPropertyUnary(internalName, label, description));
- return me();
- }
-
- /**
- * @deprecated Use this method if you want to present users a single-value selection of all available input
- * event properties.
- *
- * Adds a new {@link org.apache.streampipes.model.staticproperty.MappingPropertyUnary}
- * to the pipeline element definition which is not linked to a specific input property.
- *
- * @param label
- * @return this
- *
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K unaryMappingPropertyWithoutRequirement(Label label) {
- this.staticProperties.add(
- new MappingPropertyUnary(label.getInternalId(), label.getLabel(), label.getDescription()));
- return me();
- }
-
/**
* Adds a new {@link org.apache.streampipes.model.staticproperty.MappingPropertyUnary}
* to the pipeline element definition which is not linked to a specific input property.
@@ -247,29 +196,11 @@ public abstract class AbstractProcessingElementBuilder<K extends
return me();
}
- /**
- * @deprecated Use {@link #requiredStream(CollectedStreamRequirements)} instead
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K setStream1() {
- stream1 = true;
- return me();
- }
-
- /**
- * @deprecated Use {@link #requiredStream(CollectedStreamRequirements)} instead
- */
- @Deprecated(since = "0.90.0", forRemoval = true)
- public K setStream2() {
- stream2 = true;
- return me();
- }
public K withVersion(int version) {
this.elementDescription.setVersion(version);
return me();
}
-
@Override
public void prepareBuild() {
this.elementDescription.setStaticProperties(getStaticProperties());