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

net.serenitybdd.plugins.jira.domain.RenderedView Maven / Gradle / Ivy

There is a newer version: 4.2.9
Show newest version
package net.serenitybdd.plugins.jira.domain;

import java.util.Map;
import java.util.Optional;

public class RenderedView {
    private static final String RENDERED_DESCRIPTION_FIELD = "Description";

    private final Map renderedFieldValues;

    public RenderedView(Map renderedFieldValues) {
        this.renderedFieldValues = renderedFieldValues;
    }

    public String getDescription() {
        return renderedFieldValues.containsKey(RENDERED_DESCRIPTION_FIELD) ?
                renderedFieldValues.get(RENDERED_DESCRIPTION_FIELD) : renderedFieldValues.get(RENDERED_DESCRIPTION_FIELD.toLowerCase());

    }

    public boolean hasField(String field) {
        return renderedFieldValues.containsKey(field);
    }

    public Optional customField(String field) {
        return Optional.ofNullable(renderedFieldValues.get(field));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy