/*
- * 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
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
//
}
}
+ //
+ // 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);
+ }
+
}