All Downloads are FREE. Search and download functionalities are using the official Maven repository.

name.remal.gradle_plugins.merge_resources.mergers.BytecodeModuleRequire Maven / Gradle / Ivy

The newest version!
package name.remal.gradle_plugins.merge_resources.mergers;

import static name.remal.gradle_plugins.toolkit.ObjectUtils.isNotEmpty;

import javax.annotation.Nullable;
import lombok.NonNull;
import lombok.Value;
import lombok.val;

@Value
class BytecodeModuleRequire {

    @NonNull
    String module;

    @NonNull
    BytecodeModifiers modifiers;

    @Nullable
    String version;

    @Override
    public String toString() {
        val sb = new StringBuilder();
        sb.append("requires ");

        val modifiersString = modifiers.toString();
        if (!modifiersString.isEmpty()) {
            sb.append(modifiersString).append(' ');
        }

        sb.append(module);

        if (isNotEmpty(version)) {
            sb.append('@').append(version);
        }

        return sb.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy