Package monq.jfa
Interface StateValueMerger<V>
- Type Parameters:
V- type of values to merge
- All Known Implementing Classes:
PrioritizedValueMerger
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Merges a list of values into one result.
-
Method Summary
Modifier and TypeMethodDescriptionShould derive a valueVfrom the values provided.static <T> StateValueMerger<T> strict()Provides a merger which fails if the given list of values contains more than one different value, where "different" is decided by identity (==) rather thanequals().
-
Method Details
-
strict
Provides a merger which fails if the given list of values contains more than one different value, where "different" is decided by identity (==) rather thanequals(). -
merge
Should derive a valueVfrom the values provided. The result may be one of the values provided or a newly created one. Changing one of the provided values is most likely not what you should do.The result of the method should not depend on the order of the values. The parameter is not a
Setmainly because this would require that values behave sanely as set members (hashCode, equals).- Parameters:
values- is guaranteed to contain at least two values- Returns:
- should never be
null - Throws:
CompileDfaException- if no useful value can be determinedIllegalArgumentException- if the list is empty
-