package com.sunyard.chsm.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author liulu
 * @since 2024/10/17
 */
@Getter
@AllArgsConstructor
public enum ManufacturerEnum {

    SUNYARD("sunyard", "信雅达"),
    ;

    private final String code;
    private final String name;

    public static ManufacturerEnum of(String code) {
        if (code == null || code.trim().isEmpty()) {
            return null;
        }

        return Arrays.stream(ManufacturerEnum.values())
                .filter(it -> Objects.equals(it.code, code))
                .findFirst()
                .orElse(null);
    }

}
