Enum MapFeature
- java.lang.Object
-
- java.lang.Enum<MapFeature>
-
- com.google.common.collect.testing.features.MapFeature
-
- All Implemented Interfaces:
Feature<Map>,Serializable,Comparable<MapFeature>
@GwtCompatible public enum MapFeature extends Enum<MapFeature> implements Feature<Map>
Optional features of classes derived fromMap.- Author:
- George van den Driessche
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMapFeature.Require
-
Enum Constant Summary
Enum Constants Enum Constant Description ALLOWS_ANY_NULL_QUERIESThe map does not throwNullPointerExceptionon anynullqueries.ALLOWS_NULL_ENTRY_QUERIESThe map does not throwNullPointerExceptionon calls such asentrySet().contains(null)orentrySet().remove(null)ALLOWS_NULL_KEY_QUERIESThe map does not throwNullPointerExceptionon calls such ascontainsKey(null),get(null),keySet().contains(null)orremove(null).ALLOWS_NULL_KEYSALLOWS_NULL_VALUE_QUERIESThe map does not throwNullPointerExceptionon calls such ascontainsValue(null),values().contains(null)orvalues().remove(null).ALLOWS_NULL_VALUESFAILS_FAST_ON_CONCURRENT_MODIFICATIONGENERAL_PURPOSEREJECTS_DUPLICATES_AT_CREATIONIndicates that the constructor or factory method of a map, usually an immutable map, throws anIllegalArgumentExceptionwhen presented with duplicate keys instead of discarding all but one.RESTRICTS_KEYSRESTRICTS_VALUESSUPPORTS_PUTSUPPORTS_REMOVE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Feature<? super Map>>getImpliedFeatures()Returns the set of features that are implied by this feature.static MapFeaturevalueOf(String name)Returns the enum constant of this type with the specified name.static MapFeature[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ALLOWS_NULL_KEY_QUERIES
public static final MapFeature ALLOWS_NULL_KEY_QUERIES
The map does not throwNullPointerExceptionon calls such ascontainsKey(null),get(null),keySet().contains(null)orremove(null).
-
ALLOWS_NULL_KEYS
public static final MapFeature ALLOWS_NULL_KEYS
-
ALLOWS_NULL_VALUE_QUERIES
public static final MapFeature ALLOWS_NULL_VALUE_QUERIES
The map does not throwNullPointerExceptionon calls such ascontainsValue(null),values().contains(null)orvalues().remove(null).
-
ALLOWS_NULL_VALUES
public static final MapFeature ALLOWS_NULL_VALUES
-
ALLOWS_NULL_ENTRY_QUERIES
public static final MapFeature ALLOWS_NULL_ENTRY_QUERIES
The map does not throwNullPointerExceptionon calls such asentrySet().contains(null)orentrySet().remove(null)
-
ALLOWS_ANY_NULL_QUERIES
public static final MapFeature ALLOWS_ANY_NULL_QUERIES
The map does not throwNullPointerExceptionon anynullqueries.
-
RESTRICTS_KEYS
public static final MapFeature RESTRICTS_KEYS
-
RESTRICTS_VALUES
public static final MapFeature RESTRICTS_VALUES
-
SUPPORTS_PUT
public static final MapFeature SUPPORTS_PUT
-
SUPPORTS_REMOVE
public static final MapFeature SUPPORTS_REMOVE
-
FAILS_FAST_ON_CONCURRENT_MODIFICATION
public static final MapFeature FAILS_FAST_ON_CONCURRENT_MODIFICATION
-
REJECTS_DUPLICATES_AT_CREATION
public static final MapFeature REJECTS_DUPLICATES_AT_CREATION
Indicates that the constructor or factory method of a map, usually an immutable map, throws anIllegalArgumentExceptionwhen presented with duplicate keys instead of discarding all but one.
-
GENERAL_PURPOSE
public static final MapFeature GENERAL_PURPOSE
-
-
Method Detail
-
values
public static MapFeature[] 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 (MapFeature c : MapFeature.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MapFeature 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
-
getImpliedFeatures
public Set<Feature<? super Map>> getImpliedFeatures()
Description copied from interface:FeatureReturns the set of features that are implied by this feature.- Specified by:
getImpliedFeaturesin interfaceFeature<Map>
-
-