Module io.github.sugarcubes.cloner
Package io.github.sugarcubes.cloner
Class UncopyableObjectException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.sugarcubes.cloner.ClonerException
io.github.sugarcubes.cloner.UncopyableObjectException
- All Implemented Interfaces:
Serializable
Thrown when the cloner meets a live object of the JVM or the operating system (a thread, a reference, an open file,
a socket, a process, an executor) and the developer has not chosen what the clone gets: a clone cannot get its own
one, and sharing the original must be chosen explicitly by
CopyAction.ORIGINAL (or CopyAction.CLEAR)
for the type, the field or the object, or by a copier of the type.
The message tells the classes of the objects holding the uncopyable one, nearest first, as far as they are known: in the sequential mode only the nearest one.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUncopyableObjectException(Class<?> type) Constructor.UncopyableObjectException(Class<?> type, String reason, Throwable cause) Constructor. -
Method Summary
Methods inherited from class io.github.sugarcubes.cloner.ClonerException
replaceIfMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UncopyableObjectException
Constructor.- Parameters:
type- type of the uncopyable object
-
UncopyableObjectException
Constructor.- Parameters:
type- type of the uncopyable objectreason- why the object cannot be copiedcause- cause ornull
-
-
Method Details
-
getType
Returns the type of the uncopyable object.- Returns:
- type
-
addHolder
Adds the class of an object holding the uncopyable one, farther than the added before.- Parameters:
holder- class of the holding object
-
getMessage
- Overrides:
getMessagein classThrowable
-