X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FDefaultOwnIdentity.java;h=c461c8b89dfa9fd1a162ebaaf29e28c9bf5cb2dd;hp=ab967564c6df39b771e775919ffbc73eb1797688;hb=a47643aed43d118ca68044f95451bb5374cdb332;hpb=028d7e98954c9dbeae4515146c36d55dddd7f648 diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java b/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java index ab96756..c461c8b 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java @@ -1,5 +1,5 @@ /* - * Sone - DefaultOwnIdentity.java - Copyright © 2010 David Roden + * Sone - DefaultOwnIdentity.java - Copyright © 2010–2012 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -57,6 +57,22 @@ 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(); + setContextsPrivate(ownIdentity.getContexts()); + setPropertiesPrivate(ownIdentity.getProperties()); + } + // // ACCESSORS // @@ -167,4 +183,26 @@ public class DefaultOwnIdentity extends DefaultIdentity implements OwnIdentity { } } + // + // OBJECT METHODS + // + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + /* The hash of DefaultIdentity is fine. */ + return super.hashCode(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object object) { + /* The ID of the superclass is still enough. */ + return super.equals(object); + } + }