Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the Rollout filtration fields with status and Distribution set #1380

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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