001package io.avaje.inject.spi;
002
003import java.util.Optional;
004
005import org.jspecify.annotations.NullMarked;
006
007/**
008 * Plugin interface which contains the application properties used for wiring. Used with
009 * {@link io.avaje.inject.RequiresProperty} and {@link io.avaje.inject.Profile}.
010 *
011 * @see InjectExtension
012 */
013@NullMarked
014public interface ConfigPropertyPlugin extends InjectExtension {
015
016  /** Return a configuration value that might not exist. */
017  Optional<String> get(String property);
018
019  /** Return true if the property is defined. */
020  boolean contains(String property);
021
022  /** Return true if the property is not defined. */
023  default boolean missing(String property) {
024    return !contains(property);
025  }
026
027  /** Return true if the property is equal to the given value. */
028  boolean equalTo(String property, String value);
029
030  /** Return true if the property is not defined or not equal to the given value. */
031  default boolean notEqualTo(String property, String value) {
032    return !equalTo(property, value);
033  }
034}