001/*
002 * PermissionsEx
003 * Copyright (C) zml and PermissionsEx contributors
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package ca.stellardrift.permissionsex.datastore;
018
019import net.kyori.adventure.text.Component;
020import org.immutables.value.Value;
021
022/**
023 * A possible result of a conversion lookup.
024 *
025 * @since 2.0.0
026 */
027@Value.Immutable
028public interface ConversionResult {
029
030    /**
031     * Create a new builder for a conversion result.
032     *
033     * @return new builder
034     * @since 2.0.0
035     */
036    static Builder builder() {
037        return new Builder();
038    }
039
040    /**
041     * A short description of the data that will be converted.
042     *
043     * @return conversion description
044     * @since 2.0.0
045     */
046    Component description();
047
048    /**
049     * The data store, configured based on the discovered environment but not yet initialized.
050     *
051     * @return convertible data store
052     * @since 2.0.0
053     */
054    ProtoDataStore<?> store();
055
056    /**
057     * Builder for a conversion result.
058     *
059     * @since 2.0.0
060     */
061    class Builder extends ConversionResultImpl.Builder {
062        Builder() {}
063    }
064
065}