package com.ycwl.basic.image.watermark.enums;

import lombok.Getter;

@Getter
public enum ImageWatermarkOperatorEnum {
    WATERMARK("defW", "jpg"),
    LEICA("leica", "png"),
    NORMAL("normal", "png");

    private final String type;
    private final String preferFileType;

    ImageWatermarkOperatorEnum(String type, String preferFileType) {
        this.type = type;
        this.preferFileType = preferFileType;
    }

    public static ImageWatermarkOperatorEnum getByCode(String type) {
        for (ImageWatermarkOperatorEnum imageWatermarkOperatorEnum : ImageWatermarkOperatorEnum.values()) {
            if (imageWatermarkOperatorEnum.type.equals(type)) {
                return imageWatermarkOperatorEnum;
            }
        }
        return null;
    }
}
