65 lines
1.8 KiB
Java
65 lines
1.8 KiB
Java
/*
|
|
* This file is part of Player Analytics (Plan).
|
|
*
|
|
* Plan is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License v3 as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Plan is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
package com.djrapitops.plan.gathering.domain;
|
|
|
|
import java.util.Objects;
|
|
|
|
/**
|
|
* Represents a plugin that is installed on a server.
|
|
*
|
|
* @author AuroraLS3
|
|
*/
|
|
public class PluginMetadata {
|
|
|
|
private final String name;
|
|
private final String version;
|
|
|
|
public PluginMetadata(String name, String version) {
|
|
this.name = name;
|
|
this.version = version;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public String getVersion() {
|
|
return version;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
PluginMetadata that = (PluginMetadata) o;
|
|
return Objects.equals(getName(), that.getName()) && Objects.equals(getVersion(), that.getVersion());
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(getName(), getVersion());
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "PluginMetadata{" +
|
|
"name='" + name + '\'' +
|
|
", version='" + version + '\'' +
|
|
'}';
|
|
}
|
|
}
|