Methods Summary |
---|
public final boolean | isImmutable()Checks to see whether or not this instance is immutable. This is the
same as calling !isMutable() .
return !mutable;
|
public final boolean | isMutable()Checks to see whether or not this instance is mutable.
return mutable;
|
public void | setImmutable()Makes this instance immutable.
mutable = false;
|
public final void | throwIfImmutable()Throws {@link MutabilityException} if this instance is
immutable.
if (!mutable) {
throw new MutabilityException("immutable instance");
}
|
public final void | throwIfMutable()Throws {@link MutabilityException} if this instance is mutable.
if (mutable) {
throw new MutabilityException("mutable instance");
}
|