- java.lang.Object
-
- java.lang.Enum<JSONOptions.DuplicateBehavior>
-
- at.syntaxerror.json5.JSONOptions.DuplicateBehavior
-
- All Implemented Interfaces:
Serializable,Comparable<JSONOptions.DuplicateBehavior>
- Enclosing class:
- JSONOptions
public static enum JSONOptions.DuplicateBehavior extends Enum<JSONOptions.DuplicateBehavior>
An enum containing all supported behaviors for duplicate keys- Since:
- 1.3.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DUPLICATEWraps duplicate values inside anarray, effectively treating them as if they were declared as oneLAST_WINSOnly the last encountered value is significant, all previous occurrences are silently discardedUNIQUEThrows anexceptionwhen a key is encountered multiple times within the same object
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JSONOptions.DuplicateBehaviorvalueOf(String name)Returns the enum constant of this type with the specified name.static JSONOptions.DuplicateBehavior[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNIQUE
public static final JSONOptions.DuplicateBehavior UNIQUE
Throws anexceptionwhen a key is encountered multiple times within the same object
-
LAST_WINS
public static final JSONOptions.DuplicateBehavior LAST_WINS
Only the last encountered value is significant, all previous occurrences are silently discarded
-
DUPLICATE
public static final JSONOptions.DuplicateBehavior DUPLICATE
Wraps duplicate values inside anarray, effectively treating them as if they were declared as one
-
-
Method Detail
-
values
public static JSONOptions.DuplicateBehavior[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (JSONOptions.DuplicateBehavior c : JSONOptions.DuplicateBehavior.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JSONOptions.DuplicateBehavior valueOf(String name)
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
-
-