X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FWebOfTrustUpdater.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FWebOfTrustUpdater.java;h=ac38571072cef0764b3772cceb6999deb71a3f6e;hp=b8060d448ad03ed672a0c22ff43b14682338d8f0;hb=22006a7103d1e43dbf0474e58707fe7fea9356e1;hpb=7cb98875e6d24a4f4f54ceaadfa4fbab23183bdb 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); + } + } }