public enum Mutability extends java.lang.Enum<Mutability>
Enum Constant and Description |
---|
MUTABLE
A value is known to be mutable (e.g.
|
UNKNOWN
Mutability is not known; probably value can be mutated
|
UNMODIFIABLE
A value is known to be immutable.
|
UNMODIFIABLE_VIEW
A value is known to be an immutable view over a possibly mutable value: it cannot be mutated directly using this
reference; however subsequent reads (e.g.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
UNMODIFIABLE_ANNOTATION |
static java.lang.String |
UNMODIFIABLE_VIEW_ANNOTATION |
Modifier and Type | Method and Description |
---|---|
PsiAnnotation |
asAnnotation(Project project) |
DfReferenceType |
asDfType() |
static Mutability |
fromDfType(DfType dfType) |
static Mutability |
getMutability(PsiModifierListOwner owner)
Returns a mutability of the supplied element, if known.
|
Mutability |
intersect(Mutability other) |
boolean |
isUnmodifiable() |
java.lang.String |
toString() |
Mutability |
unite(Mutability other) |
static Mutability |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Mutability[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Mutability UNKNOWN
public static final Mutability MUTABLE
public static final Mutability UNMODIFIABLE_VIEW
Collection.size()
) may return different results if the
underlying value is mutated by somebody else.public static final Mutability UNMODIFIABLE
public static final java.lang.String UNMODIFIABLE_ANNOTATION
public static final java.lang.String UNMODIFIABLE_VIEW_ANNOTATION
public static Mutability[] values()
for (Mutability c : Mutability.values()) System.out.println(c);
public static Mutability valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic DfReferenceType asDfType()
public java.lang.String toString()
toString
in class java.lang.Enum<Mutability>
public boolean isUnmodifiable()
public Mutability unite(Mutability other)
public Mutability intersect(Mutability other)
public PsiAnnotation asAnnotation(Project project)
public static Mutability getMutability(PsiModifierListOwner owner)
owner
- an element to check the mutabilityUNKNOWN
if cannot be determined or specified element type is not supported.public static Mutability fromDfType(DfType dfType)