package com.knecon.fforesight.service.viewerdoc.layers;

import java.util.List;

import com.knecon.fforesight.service.viewerdoc.LayerIdentifier;
import com.knecon.fforesight.service.viewerdoc.model.Visualizations;

public interface LayerGroup {

    LayerIdentifier getGroupIdentifier();


    List<Visualizations> getVisualizations();


    default List<LayerIdentifier> getSubLayers() {

        return getVisualizations().stream()
                .map(Visualizations::getLayer)
                .toList();

    }


    default boolean isVisibleByDefault() {

        return false;
    }


    /*
    indicates the sub layers are all optional content
     */
    default boolean subLayersAreOptionalContent() {

        return true;
    }


    /*
    indicates the LayerGroup is also a optional content group, and should be displayed as such:
    layer
        - sublayer0
        - sublayer1

    see note in specification 8.11.4.3
     */
    default boolean isOptionalContent() {

        return true;
    }


    default boolean isEmpty() {

        return getVisualizations().isEmpty();
    }




}
