Class ImmutableDetector
java.lang.Object
com.comphenix.protocol.reflect.cloning.ImmutableDetector
- All Implemented Interfaces:
Cloner
Detects classes that are immutable, and thus doesn't require cloning.
This ought to have no false positives, but plenty of false negatives.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ImmutableDetector
public ImmutableDetector()
-
-
Method Details
-
canClone
Description copied from interface:ClonerDetermine whether the current cloner can clone the given object. -
isImmutable
Determine if the given type is probably immutable.- Parameters:
type- - the type to check.- Returns:
- TRUE if the type is immutable, FALSE otherwise.
-
clone
Description copied from interface:ClonerPerform the clone.This method should never be called unless a corresponding
Cloner.canClone(Object)returns TRUE.
-