Add request ID
[fonbot.git] / src / ro / ieval / fonbot / Address.java
index 59fc0d74ccf6f055b21965c0e72a435712e3a4da..5777cfe54978799a41e3582222adc3150f465429 100644 (file)
@@ -65,6 +65,9 @@ final class Address {
         */
        public final String data;
 
+       /** The ID of this request. Used in annotations. Can be null */
+       public final transient String requestId;
+
        /**
         * Construct an Address from its parts
         * 
@@ -74,6 +77,20 @@ final class Address {
        public Address(final Protocol protocol, final @Nullable String data){
                this.protocol=protocol;
                this.data=data;
+               this.requestId=null;
+       }
+
+       /**
+        * Construct an Address from its parts
+        *
+        * @param protocol the protocol part of the Address
+        * @param data the data part of the Address
+        * @param requestId the request ID
+        */
+       public Address(final Protocol protocol, final @Nullable String data, final String requestId){
+               this.protocol=protocol;
+               this.data=data;
+               this.requestId=requestId;
        }
 
        /**
@@ -86,6 +103,7 @@ final class Address {
                final String[] parts=address.split(" ", 2);
                this.protocol=Protocol.valueOf(parts[0]);
                this.data=parts[1];
+               this.requestId=null;
        }
 
        /**
This page took 0.009696 seconds and 4 git commands to generate.