package io.xpipe.ext.base.service;

import io.xpipe.app.ext.DataStore;
import io.xpipe.app.storage.DataStoreCategory;
import io.xpipe.app.storage.DataStoreEntry;

import java.util.List;

public class FixedServiceGroupStoreProvider extends AbstractServiceGroupStoreProvider {

    @Override
    public DataStore defaultStore(DataStoreCategory category) {
        return FixedServiceGroupStore.builder().build();
    }

    @Override
    public String getId() {
        return "fixedServiceGroup";
    }

    @Override
    public List<Class<?>> getStoreClasses() {
        return List.of(FixedServiceGroupStore.class);
    }

    @Override
    public DataStoreEntry getDisplayParent(DataStoreEntry store) {
        FixedServiceGroupStore s = store.getStore().asNeeded();
        return s.getParent() != null ? s.getParent().get() : null;
    }
}
