package ru.yandex.webmaster3.storage.antispam.threats.data;

import ru.yandex.webmaster3.proto.Antispam;

/**
 * Created by Oleg Bazdyrev on 09/08/2017.
 */
public enum ThreatPropagationMode {

    OWNER,
    SUBDOMAINS,
    ;

    public static ThreatPropagationMode fromProto(Antispam.PropagationMode mode) {
        if (mode == null) {
            return null;
        }
        switch (mode) {
            case OWNER:
                return OWNER;
            case SUBDOMAINS:
                return SUBDOMAINS;
        }
        throw new IllegalArgumentException();
    }

}
