Package uk.ac.diamond.daq.configuration
Record Class ConfigurationOptions
java.lang.Object
java.lang.Record
uk.ac.diamond.daq.configuration.ConfigurationOptions
public record ConfigurationOptions(Stream<String> options, ConfigurationOptions.Action action)
extends Record
Wrapper around a stream of Strings that also indicates whether subsequent options from other
sources should be included.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationOptions(Stream<String> options, ConfigurationOptions.Action action) Creates an instance of aConfigurationOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.effectiveOptions(Collection<ConfigurationSource> sources, Function<ConfigurationSource, ConfigurationOptions> extract) static ConfigurationOptionsempty()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.merge(ConfigurationOptions other) Merge another stream of options into this oneoptions()Returns the value of theoptionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConfigurationOptions
Creates an instance of aConfigurationOptionsrecord class.- Parameters:
options- the value for theoptionsrecord componentaction- the value for theactionrecord component
-
-
Method Details
-
merge
Merge another stream of options into this oneThe resultant stream will either be this stream if it is set to overwrite (and should therefore ignore any subsequent options) or a new stream combining the options from both streams and the overwrite behaviour of the merged options.
- Parameters:
other- The otherConfigurationOptionsto be merged into this one- Returns:
- A new
ConfigurationOptionsthat reflects the combination of the two streams
-
effectiveOptions
public static Stream<String> effectiveOptions(Collection<ConfigurationSource> sources, Function<ConfigurationSource, ConfigurationOptions> extract) -
empty
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-