package com.bocloud.cmp.model.hmc.enums;

import java.util.Arrays;
import java.util.Optional;

public enum VirtualScsiAdapterType {
    CLIENT("Client"),
    SERVER("Server");
    private final String type;

    VirtualScsiAdapterType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public static Optional<VirtualScsiAdapterType> byTypeOpt(String type) {
        return Arrays.stream(VirtualScsiAdapterType.values()).filter(t -> t.getType().equals(type)).findFirst();
    }

    public static VirtualScsiAdapterType byTypeNullable(String type) {
        return byTypeOpt(type).orElse(null);
    }
}
