public class EnvironmentVariableUsagePropertyProvider extends Object implements UsagePropertyProvider
UsagePropertyProvider implementation that reads the usage properties from the environment variables. The
priority is half of max integer value, meaning it will be overridden by the command-line properties provider.| Modifier and Type | Class and Description |
|---|---|
static interface |
EnvironmentVariableUsagePropertyProvider.EnvironmentVariableSupplier
A functional interface to supply environment variables.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DISABLED_KEY
The environment variable key to check if the update checker is disabled.
|
static String |
URL_KEY
The environment variable key to retrieve the URL for the usage collection endpoint.
|
| Constructor and Description |
|---|
EnvironmentVariableUsagePropertyProvider()
Creates a new
EnvironmentVariableUsagePropertyProvider that reads properties from the system environment. |
EnvironmentVariableUsagePropertyProvider(EnvironmentVariableUsagePropertyProvider.EnvironmentVariableSupplier envSupplier)
Creates a new
EnvironmentVariableUsagePropertyProvider that reads properties from the provided
EnvironmentVariableUsagePropertyProvider.EnvironmentVariableSupplier. |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
getDisabled()
Returns whether the Anonymous Usage Collection is disabled.
|
String |
getUrl()
Returns the URL for the Anonymous Usage Collection endpoint.
|
int |
priority()
Returns the priority of this property provider.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic static final String DISABLED_KEY
public static final String URL_KEY
public EnvironmentVariableUsagePropertyProvider()
EnvironmentVariableUsagePropertyProvider that reads properties from the system environment.
This constructor uses System.getenv() as the default supplier for environment variables.public EnvironmentVariableUsagePropertyProvider(EnvironmentVariableUsagePropertyProvider.EnvironmentVariableSupplier envSupplier)
EnvironmentVariableUsagePropertyProvider that reads properties from the provided
EnvironmentVariableUsagePropertyProvider.EnvironmentVariableSupplier. This allows for custom implementations to provide environment variable
values, which can be useful for testing or when the default System.getenv() is not suitable.envSupplier - The supplier to use for retrieving environment variables.public Boolean getDisabled()
UsagePropertyProvidergetDisabled in interface UsagePropertyProvidertrue if the collection is disabled, null if not specified, or false if enabled.public String getUrl()
UsagePropertyProvidergetUrl in interface UsagePropertyProviderString, or null if not specified.public int priority()
UsagePropertyProviderpriority in interface UsagePropertyProviderint representing the priority of this provider.Copyright © 2010–2025. All rights reserved.