Enum Replacements.CoalescePolicy
- All Implemented Interfaces:
Serializable
,Comparable<Replacements.CoalescePolicy>
,java.lang.constant.Constable
- Enclosing class:
Replacements
A policy for handling overlapping insertions.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAccept overlapping insertions, with the existing insertion before the new one.Reject overlapping inserts, but treat duplicate inserts (same text at same position) specially.Reject overlapping insertions and throw anIllegalArgumentException
.Accept overlapping insertions, with the new insertion before the existing one. -
Method Summary
Modifier and TypeMethodDescriptionabstract String
Handle two insertions at the same position.static Replacements.CoalescePolicy
Returns the enum constant of this type with the specified name.static Replacements.CoalescePolicy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
REJECT
Reject overlapping insertions and throw anIllegalArgumentException
. -
REPLACEMENT_FIRST
Accept overlapping insertions, with the new insertion before the existing one. Duplicate insertions (inserting the same text at the same position) will still be dropped. -
EXISTING_FIRST
Accept overlapping insertions, with the existing insertion before the new one. Duplicate insertions (inserting the same text at the same position) will still be dropped. -
KEEP_ONLY_IDENTICAL_INSERTS
Reject overlapping inserts, but treat duplicate inserts (same text at same position) specially. Instead of dropping duplicates, as the other coalesce policies do, this policy keeps them.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
coalesce
-