Package org.plumelib.util
Class ImmutableTypes
java.lang.Object
org.plumelib.util.ImmutableTypes
Records all the immutable types in the JDK, and can be queried.
-
Field Summary
Modifier and TypeFieldDescriptionThe names of the immutable types. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isImmutable
(String typeName) Returns true iff the class of the given name is immutable.
-
Field Details
-
immutableTypeNames
The names of the immutable types. This is public so that clients can extend it with bug fixes or application-specific types. (Or, make a pull request to add more types to this file.)The set generally does not contain interfaces, because types that implement an interface may be mutable even if the interface provides no mutating methods.
-
-
Method Details
-
isImmutable
Returns true iff the class of the given name is immutable.- Parameters:
typeName
- the fully-qualified name of the type- Returns:
- true iff the class of the given name is immutable
-