ch.sbb.polarion.extension.api.extender.settings.ProjectCustomFieldsSettingsModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ch.sbb.polarion.extension.api-extender Show documentation
Show all versions of ch.sbb.polarion.extension.api-extender Show documentation
This Polarion extension provides additional functionality which is not implemented in standard Polarion API for some reason
The newest version!
package ch.sbb.polarion.extension.api.extender.settings;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.util.ArrayList;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@ToString
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ProjectCustomFieldsSettingsModel extends AuthSettingsModel {
@Override
protected String serializeModelData() {
return serializeEntry(GLOBAL_ROLES, serializeRoles(globalRoles)) +
serializeEntry(PROJECT_ROLES, serializeRoles(projectRoles));
}
@Override
protected void deserializeModelData(String serializedString) {
globalRoles = deserializeRoles(GLOBAL_ROLES, serializedString);
projectRoles = deserializeRoles(PROJECT_ROLES, serializedString);
}
@JsonIgnore
public List getAllRoles() {
List roles = new ArrayList<>();
roles.addAll(getGlobalRoles());
roles.addAll(getProjectRoles());
return roles;
}
}