|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<MutabilityReason>
org.mutabilitydetector.MutabilityReason
public enum MutabilityReason
The various reasons that instances of a class can be considered mutable.
| Enum Constant Summary | |
|---|---|
ABSTRACT_COLLECTION_TYPE_TO_FIELD
|
|
ABSTRACT_TYPE_INHERENTLY_MUTABLE
Abstract types (interfaces or abstract classes) are considered to be \"Inherently Mutable\" in particular cases. |
|
ABSTRACT_TYPE_TO_FIELD
For an object to be immutable, its fields must also be immutable. |
|
ARRAY_TYPE_INHERENTLY_MUTABLE
Since an array can be mutated after construction (by modifying what it contains) they are inherently mutable. |
|
CAN_BE_SUBCLASSED
The given class can be subclassed. |
|
CANNOT_ANALYSE
Class could not be analysed. |
|
COLLECTION_FIELD_WITH_MUTABLE_ELEMENT_TYPE
|
|
ESCAPED_THIS_REFERENCE
[Experimental] The 'this' reference escaped during construction. |
|
FIELD_CAN_BE_REASSIGNED
For a class to be immutable, fields cannot be reassigned once an instance is constructed. |
|
MUTABLE_TYPE_TO_FIELD
A mutable type can be assigned to a field. |
|
NON_FINAL_FIELD
Field is not declared final. |
|
NULL_REASON
This is a placeholder reason. |
|
PUBLISHED_NON_FINAL_FIELD
Class has a published, non-final field. |
|
| Method Summary | |
|---|---|
String |
code()
|
IsImmutable |
createsResult()
|
String |
description()
|
boolean |
isOneOf(Reason... reasons)
|
static MutabilityReason |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static MutabilityReason[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final MutabilityReason CANNOT_ANALYSE
public static final MutabilityReason ABSTRACT_TYPE_TO_FIELD
public static final MutabilityReason ABSTRACT_COLLECTION_TYPE_TO_FIELD
public static final MutabilityReason COLLECTION_FIELD_WITH_MUTABLE_ELEMENT_TYPE
public static final MutabilityReason CAN_BE_SUBCLASSED
public static final MutabilityReason ABSTRACT_TYPE_INHERENTLY_MUTABLE
public static final MutabilityReason ARRAY_TYPE_INHERENTLY_MUTABLE
public static final MutabilityReason MUTABLE_TYPE_TO_FIELD
public static final MutabilityReason ESCAPED_THIS_REFERENCE
public static final MutabilityReason NON_FINAL_FIELD
public static final MutabilityReason PUBLISHED_NON_FINAL_FIELD
public static final MutabilityReason FIELD_CAN_BE_REASSIGNED
public static final MutabilityReason NULL_REASON
| Method Detail |
|---|
public static MutabilityReason[] values()
for (MutabilityReason c : MutabilityReason.values()) System.out.println(c);
public static MutabilityReason valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic String description()
description in interface Reasonpublic String code()
code in interface Reasonpublic IsImmutable createsResult()
createsResult in interface Reasonpublic boolean isOneOf(Reason... reasons)
isOneOf in interface Reason
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||