Record Class ConfigureSpec
java.lang.Object
java.lang.Record
org.variantsync.diffdetective.variation.tree.view.relevance.spec.ConfigureSpec
- All Implemented Interfaces:
Predicate<VariationNode<?,,?>> Source,Relevance
This class serves as a specification for
Configure.
Both classes must act semantically equivalent as a Relevance predicate.
Whereas Configure is an implementation optimized to avoid SAT calls where necessary, the implementation in ConfigureSpec
is kept simple by design to remain verifiable.
ConfigureSpec tests a partial configuration against a variation tree or diff by checking each node individually.
To this end ConfigureSpec uses the default, naive implementations of Relevance instead of providing
optimized implementations for tree traversal as Configure does.
This class is not intended for production use and rather is supposed to be used in tests.- Author:
- Paul Bittner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FixTrueFalse.FormulaThe field for theconfigrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionConfigureSpec(org.prop4j.Node configuration) ConfigureSpec(FixTrueFalse.Formula config) Creates an instance of aConfigureSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionconfig()Returns the value of theconfigrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns a list of arguments required to understand this source.Returns a short, one line explanation or identifier of this source.final inthashCode()Returns a hash code value for this object.static booleantest(FixTrueFalse.Formula formula, VariationNode<?, ?> v) booleantest(VariationNode<?, ?> t) toString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.variantsync.diffdetective.variation.tree.view.relevance.Relevance
computeViewNodesMethods inherited from interface org.variantsync.diffdetective.util.Source
fullExplanation, functionExplanation, getRootSource, getSources, shallowExplanation
-
Field Details
-
config
The field for theconfigrecord component.
-
-
Constructor Details
-
ConfigureSpec
public ConfigureSpec(org.prop4j.Node configuration) -
ConfigureSpec
Creates an instance of aConfigureSpecrecord class.- Parameters:
config- the value for theconfigrecord component
-
-
Method Details
-
test
-
test
- Specified by:
testin interfacePredicate<VariationNode<?,?>>
-
getSourceArguments
Description copied from interface:SourceReturns a list of arguments required to understand this source. Each argument in the result list should represent astringwithout newlines and will be formatted together withSource.getSourceExplanation()like"sourceExplanation(argument1, argument2)"bySource.shallowExplanation(). This method is only intended to access the arguments forprinting. In case access to the well-typed object is required, useSource.<T>findFirst(org.variantsync.diffdetective.util.Source,java.lang.Class<T>)orSource.<T>findAll(org.variantsync.diffdetective.util.Source,java.lang.Class<T>)and use the accessors of the underlying type.For ease of implementing
Source, the return value is a list ofObjects instead of a list ofStrings to allow code likeList.of(arg0, arg1, arg2)instead ofList.of(arg0.toString(), arg1.toString(), arg2.toString()). Users of this function should assume nothing from the returned objects except thatObject.toString()is well behaved.- Specified by:
getSourceArgumentsin interfaceSource- Returns:
- an empty list by default
- See Also:
-
getSourceExplanation
Description copied from interface:SourceReturns a short, one line explanation or identifier of this source. The result is used bySource.shallowExplanation()and is formatted together withSource.getSourceArguments()like"sourceExplanation(argument1, argument2)".- Specified by:
getSourceExplanationin interfaceSource
-
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). -
config
Returns the value of theconfigrecord component.- Returns:
- the value of the
configrecord component
-