Skip to content

Commit

Permalink
fixed overwritten plugin properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ai-republic committed Oct 13, 2024
1 parent b59127f commit 0c1030f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public void setProperties(final Set<PluginProperty> properties) {
* @param property the property
*/
public void addProperty(final PluginProperty property) {
if (properties.contains(property)) {
removeProperty(property);
}

properties.add(property);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*/
package com.airepublic.bmstoinverter.core;

import java.util.Objects;

/**
* A property for usage in an {@link AbstractPlugin}.
*/
Expand Down Expand Up @@ -90,4 +92,26 @@ public String getDescription() {
public void setDescription(final String description) {
this.description = description;
}


@Override
public int hashCode() {
return Objects.hash(name);
}


@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final PluginProperty other = (PluginProperty) obj;
return Objects.equals(name, other.name);
}
}

0 comments on commit 0c1030f

Please sign in to comment.