001package io.avaje.inject.spi; 002 003import java.util.Optional; 004 005/** 006 * Plugin interface used with {@link io.avaje.inject.RequiresProperty}. 007 * <p> 008 * The plugin is loaded via ServiceLoader and defaults to an implementation 009 * that uses {@link System#getProperty(String)} and {@link System#getenv(String)}. 010 */ 011public interface PropertyRequiresPlugin { 012 013 /** Return a configuration value that might not exist. */ 014 Optional<String> get(String property); 015 016 /** Return true if the property is defined. */ 017 boolean contains(String property); 018 019 /** 020 * Return true if the property is not defined. 021 */ 022 boolean missing(String property); 023 024 /** 025 * Return true if the property is equal to the given value. 026 */ 027 boolean equalTo(String property, String value); 028 029 /** 030 * Return true if the property is not defined or not equal to the given value. 031 */ 032 boolean notEqualTo(String property, String value); 033}