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

net.nemerosa.ontrack.model.support.SelectableString Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.support;

import lombok.Data;

import java.util.Collection;

/**
 * Simple implementation of a {@link Selectable} item based on a name only.
 */
@Data
public class SelectableString implements Selectable {

    private final boolean selected;
    private final String name;

    @Override
    public String getId() {
        return name;
    }

    public static SelectableString of(String name, Collection names) {
        return new SelectableString(
                names.contains(name),
                name
        );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy