diff --git a/core/src/main/java/info/openrocket/core/logging/Message.java b/core/src/main/java/info/openrocket/core/logging/Message.java index 5f97fa01c..8de8254c9 100644 --- a/core/src/main/java/info/openrocket/core/logging/Message.java +++ b/core/src/main/java/info/openrocket/core/logging/Message.java @@ -1,17 +1,30 @@ package info.openrocket.core.logging; -import info.openrocket.core.rocketcomponent.RocketComponent; import java.util.Arrays; +import java.util.UUID; + +import info.openrocket.core.rocketcomponent.RocketComponent; /** * Baseclass for logging messages (warnings, errors...) */ public abstract class Message implements Cloneable { + /** Message ID **/ + UUID id; + /** The rocket component(s) that are the source of this message **/ private RocketComponent[] sources = null; private MessagePriority priority = MessagePriority.NORMAL; + protected Message() { + this.id = UUID.randomUUID(); + } + + protected Message(UUID id) { + this.id = id; + } + /** * Returns the message text + message source objects. * @return the message text + message source objects. @@ -54,6 +67,13 @@ public abstract class Message implements Cloneable { */ public abstract boolean replaceBy(Message other); + /** + * Return the ID + */ + public UUID getID() { + return id; + } + /** * Return the rocket component(s) that are the source of this warning. * @return the rocket component(s) that are the source of this warning. Returns null if no sources are specified.