Configuration
, Parameters
BaseConfiguration
, EmptyConfiguration
public abstract class AbstractConfiguration extends Object implements Configuration
Constructor | Description |
---|---|
AbstractConfiguration(Optional<Configuration> parentConfiguration) |
Parent configuration constructor.
|
Modifier and Type | Method | Description |
---|---|---|
Optional<Configuration> |
getParentConfiguration() |
|
protected static <T> Optional<T> |
or(Optional<T> optional,
Supplier<Optional<T>> supplier) |
Returns another another optional from a supplier if the given optional is not present.
|
hasParameter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBoolean, getDouble, getInt, getLong, getOptionalBoolean, getOptionalDouble, getOptionalInt, getOptionalLong, getOptionalParameter, getOptionalPath, getOptionalString, getOptionalUri, getParameter, getPath, getString, getUri, requireParameter, resolvePath
public AbstractConfiguration(@Nonnull Optional<Configuration> parentConfiguration)
parentConfiguration
- The parent configuration for fallback lookup.NullPointerException
- if the given parent configuration is null
.public Optional<Configuration> getParentConfiguration()
getParentConfiguration
in interface Configuration
protected static <T> Optional<T> or(@Nonnull Optional<T> optional, @Nonnull Supplier<Optional<T>> supplier)
This method is also found in com.globalmentor.util.Optionals
and is repeated here to prevent an additional dependency.
This method duplicates functionality in Java 9.
T
- The type of value contained in the optional.optional
- The optional to checksupplier
- The supplier of an alternative optional if the value of the given optional is not present.NullPointerException
- if the supplier is null
or returns null
.Copyright © 2018 GlobalMentor, Inc.. All rights reserved.