From 22006a7103d1e43dbf0474e58707fe7fea9356e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 12 Sep 2013 06:35:13 +0200 Subject: [PATCH] Remove another unnecessary class. --- .../pterodactylus/sone/core/WebOfTrustUpdater.java | 89 ++++++++-------------- 1 file changed, 30 insertions(+), 59 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdater.java b/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdater.java index b8060d4..ac38571 100644 --- a/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdater.java +++ b/src/main/java/net/pterodactylus/sone/core/WebOfTrustUpdater.java @@ -559,72 +559,17 @@ public class WebOfTrustUpdater extends AbstractService { } /** - * Base class for update jobs that deal with properties. + * WebOfTrust update job that sets a property on an {@link OwnIdentity}. * * @author David ‘Bombe’ Roden */ - private class WebOfTrustPropertyUpdateJob extends WebOfTrustUpdateJob { + private class SetPropertyJob extends WebOfTrustUpdateJob { /** The own identity to update properties on. */ - protected final OwnIdentity ownIdentity; + private final OwnIdentity ownIdentity; /** The name of the property to update. */ - protected final String propertyName; - - /** - * Creates a new property update job. - * - * @param ownIdentity - * The own identity to update the property on - * @param propertyName - * The name of the property to update - */ - @SuppressWarnings("synthetic-access") - public WebOfTrustPropertyUpdateJob(OwnIdentity ownIdentity, String propertyName) { - this.ownIdentity = ownIdentity; - this.propertyName = propertyName; - } - - // - // OBJECT METHODS - // - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object object) { - if ((object == null) || !object.getClass().equals(getClass())) { - return false; - } - WebOfTrustPropertyUpdateJob updateJob = (WebOfTrustPropertyUpdateJob) object; - return updateJob.ownIdentity.equals(ownIdentity) && updateJob.propertyName.equals(propertyName); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return getClass().hashCode() ^ ownIdentity.hashCode() ^ propertyName.hashCode(); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return String.format("%s[ownIdentity=%s,propertyName=%s]", getClass().getSimpleName(), ownIdentity, propertyName); - } - - } - - /** - * WebOfTrust update job that sets a property on an {@link OwnIdentity}. - * - * @author David ‘Bombe’ Roden - */ - private class SetPropertyJob extends WebOfTrustPropertyUpdateJob { + private final String propertyName; /** The value of the property to set. */ private final String propertyValue; @@ -665,6 +610,32 @@ public class WebOfTrustUpdater extends AbstractService { } } + // + // OBJECT METHODS + // + + /** {@inheritDoc} */ + @Override + public boolean equals(Object object) { + if ((object == null) || !object.getClass().equals(getClass())) { + return false; + } + SetPropertyJob updateJob = (SetPropertyJob) object; + return updateJob.ownIdentity.equals(ownIdentity) && updateJob.propertyName.equals(propertyName); + } + + /** {@inheritDoc} */ + @Override + public int hashCode() { + return getClass().hashCode() ^ ownIdentity.hashCode() ^ propertyName.hashCode(); + } + + /** {@inheritDoc} */ + @Override + public String toString() { + return String.format("%s[ownIdentity=%s,propertyName=%s]", getClass().getSimpleName(), ownIdentity, propertyName); + } + } } -- 2.7.4