Skip to content

Commit

Permalink
Extend the Rollout filtration fields with status and Distribution set
Browse files Browse the repository at this point in the history
Extend the Rollout filtration fields with status and Distribution set
  • Loading branch information
strailov authored Jun 29, 2023
2 parents db54249 + 9bf2612 commit e81c68e
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
*/
package org.eclipse.hawkbit.repository;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
* Describing the fields of the Rollout model which can be used in the REST API
* e.g. for sorting etc.
Expand All @@ -25,12 +29,35 @@ public enum RolloutFields implements FieldNameProvider {
/**
* The id field.
*/
ID("id");
ID("id"),
/**
* The status field.
*/
STATUS("status"),
/**
* The Distribution set field.
*/
DISTRIBUTIONSET("distributionSet", DistributionSetFields.ID.getFieldName(),
DistributionSetFields.NAME.getFieldName(), DistributionSetFields.VERSION.getFieldName(),
DistributionSetFields.TYPE.getFieldName());

private final String fieldName;

private final List<String> subEntityAttributes;

private RolloutFields(final String fieldName) {
this.fieldName = fieldName;
this.subEntityAttributes = Collections.emptyList();
}

private RolloutFields(final String fieldName, final String... subEntityAttributes) {
this.fieldName = fieldName;
this.subEntityAttributes = Arrays.asList(subEntityAttributes);
}

@Override
public List<String> getSubEntityAttributes() {
return Collections.unmodifiableList(subEntityAttributes);
}

@Override
Expand Down

0 comments on commit e81c68e

Please sign in to comment.