package com.atlassian.webdriver.bitbucket.element;

import com.atlassian.pageobjects.elements.PageElement;
import org.openqa.selenium.By;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Set;

@SuppressWarnings("WeakerAccess")
public class TimeZoneOption extends IdOption {

    private final PageElement option;

    public TimeZoneOption(@Nonnull PageElement container) {
        super(container);

        option = container.find(By.cssSelector(".zone"));
    }

    @Nullable
    @Override
    public String getId() {
        return option.getId();
    }

    @Nullable
    public String getValue() {
        return option.getAttribute("data-value");
    }

    @Nonnull
    Set<String> getCssClasses() {
        return option.getCssClasses();
    }
}