001/*
002 * Copyright © 2025 CUI-OpenSource-Software (info@cuioss.de)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package de.cuioss.http.client;
017
018/**
019 * Enum representing the status of a {@link de.cuioss.tools.net.http.HttpHandler} loader.
020 * <p>
021 * A loader status is:
022 * <ul>
023 *   <li>OK: if it can load at least one key or has valid content</li>
024 *   <li>ERROR: if it failed to load any keys due to configuration or runtime issues</li>
025 *   <li>LOADING: if a loading operation is currently in progress</li>
026 *   <li>UNDEFINED: if the status hasn't been determined yet</li>
027 * </ul>
028 */
029public enum LoaderStatus {
030    /** The loader is functioning properly and contains at least one key or valid content */
031    OK("ok"),
032    /** The loader has encountered an error and couldn't load any keys or content */
033    ERROR("error"),
034    /** A loading operation is currently in progress */
035    LOADING("loading"),
036    /** The loader's status hasn't been determined yet */
037    UNDEFINED("undefined");
038
039    private final String value;
040
041    LoaderStatus(String value) {
042        this.value = value;
043    }
044
045    @Override
046    public String toString() {
047        return value;
048    }
049}