All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ch.sbb.polarion.extension.api.extender.settings.ProjectCustomFieldsSettingsModel Maven / Gradle / Ivy

Go to download

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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy