Add copy-constructor for own identities.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 13 Nov 2011 11:30:24 +0000 (12:30 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 13 Nov 2011 11:30:24 +0000 (12:30 +0100)
src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java

index ab46b43..ff52684 100644 (file)
@@ -57,6 +57,20 @@ public class DefaultOwnIdentity extends DefaultIdentity implements OwnIdentity {
                this.insertUri = insertUri;
        }
 
+       /**
+        * Copy constructor for an own identity.
+        *
+        * @param webOfTrustConnector
+        *            The web of trust connector
+        * @param ownIdentity
+        *            The own identity to copy
+        */
+       public DefaultOwnIdentity(WebOfTrustConnector webOfTrustConnector, OwnIdentity ownIdentity) {
+               super(webOfTrustConnector, ownIdentity.getId(), ownIdentity.getNickname(), ownIdentity.getRequestUri());
+               this.webOfTrustConnector = webOfTrustConnector;
+               this.insertUri = ownIdentity.getInsertUri();
+       }
+
        //
        // ACCESSORS
        //