Fix DistributionSet type should not be updatable (#659)
* DistributionSet type is no longer changable for an existing distribution set in the ui. Signed-off-by: Markus Block <markus.block@bosch-si.com> * Removed field "type" from a distribution update. Signed-off-by: Markus Block <markus.block@bosch-si.com> * Incorporated review comments. Signed-off-by: Markus Block <markus.block@bosch-si.com>
This commit is contained in:
committed by
Kai Zimmermann
parent
a55c34d0bb
commit
e700acc312
@@ -8,13 +8,10 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.builder;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
||||
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
||||
|
||||
@@ -45,22 +42,6 @@ public interface DistributionSetUpdate {
|
||||
*/
|
||||
DistributionSetUpdate description(@Size(max = NamedEntity.DESCRIPTION_MAX_SIZE) String description);
|
||||
|
||||
/**
|
||||
* @param typeKey
|
||||
* for {@link DistributionSet#getType()}
|
||||
* @return updated builder instance
|
||||
*/
|
||||
DistributionSetUpdate type(@Size(min = 1, max = DistributionSetType.KEY_MAX_SIZE) @NotNull String typeKey);
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* for {@link DistributionSet#getType()}
|
||||
* @return updated builder instance
|
||||
*/
|
||||
default DistributionSetUpdate type(final DistributionSetType type) {
|
||||
return type(Optional.ofNullable(type).map(DistributionSetType::getKey).orElse(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param requiredMigrationStep
|
||||
* for {@link DistributionSet#isRequiredMigrationStep()}
|
||||
|
||||
Reference in New Issue
Block a user