org.mutabilitydetector
Enum IsImmutable

java.lang.Object
  extended by java.lang.Enum<IsImmutable>
      extended by org.mutabilitydetector.IsImmutable
All Implemented Interfaces:
Serializable, Comparable<IsImmutable>

public enum IsImmutable
extends Enum<IsImmutable>

The various classifications for instances of classes.

Author:
Graham Allan / Grundlefleck at gmail dot com

Enum Constant Summary
COULD_NOT_ANALYSE
          Instances can be any of IMMUTABLE/EFFECTIVELY_IMMUTABLE/NOT_IMMUTABLE, however, an internal error has occurred during analysis, and no result is meaningful.
EFFECTIVELY_IMMUTABLE
          Instances are only immutable when safely published.
IMMUTABLE
          Instances are perfectly immutable, can be safely published without extra synchronisation.
NOT_IMMUTABLE
          Instances are not immutable, do not cache and/or share instances, do not publish to multiple threads, do not use as keys in HashMaps.
 
Method Summary
static IsImmutable valueOf(String name)
          Returns the enum constant of this type with the specified name.
static IsImmutable[] 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

IMMUTABLE

public static final IsImmutable IMMUTABLE
Instances are perfectly immutable, can be safely published without extra synchronisation.


EFFECTIVELY_IMMUTABLE

public static final IsImmutable EFFECTIVELY_IMMUTABLE
Instances are only immutable when safely published. Extra synchronisation is required to publish effectively immutable objects safely.


NOT_IMMUTABLE

public static final IsImmutable NOT_IMMUTABLE
Instances are not immutable, do not cache and/or share instances, do not publish to multiple threads, do not use as keys in HashMaps.


COULD_NOT_ANALYSE

public static final IsImmutable COULD_NOT_ANALYSE
Instances can be any of IMMUTABLE/EFFECTIVELY_IMMUTABLE/NOT_IMMUTABLE, however, an internal error has occurred during analysis, and no result is meaningful.

Method Detail

values

public static IsImmutable[] 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 (IsImmutable c : IsImmutable.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static IsImmutable 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 name
NullPointerException - if the argument is null


Copyright © 2013. All Rights Reserved.