com.github.frontear.efkolia.impl.info.Metadata Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Efkolia Show documentation
Show all versions of Efkolia Show documentation
A simple framework designed for Minecraft modding
package com.github.frontear.efkolia.impl.info;
import com.github.frontear.efkolia.api.info.IMetadata;
import com.github.frontear.internal.*;
import lombok.*;
public final class Metadata implements IMetadata {
private final String name, version, developers;
public Metadata(@NonNull final String name, @NonNull final String version,
@NonNull final String author, @Nullable final String... contributors) {
this.name = name;
this.version = version;
if (contributors == null) {
this.developers = author;
}
else {
val authors = new String[contributors.length + 1]; // + 1 for the 'author'
authors[0] = author;
System.arraycopy(contributors, 0, authors, 1, contributors.length);
val joined = String.join(", ", authors);
val index = joined.lastIndexOf(", ");
this.developers = index != -1 ? joined.substring(0, index) + ", and " + joined
.substring(index + ", ".length()) : joined;
}
}
@NotNull
@Override
public String getName() {
return name;
}
@NotNull
@Override
public String getVersion() {
return version;
}
@NotNull
@Override
public String getDevelopers() {
return developers;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy