001package org.hl7.fhir.validation.cli.model; 002 003import org.hl7.fhir.utilities.Utilities; 004 005public enum HtmlInMarkdownCheck { 006 NONE, 007 WARNING, 008 ERROR; 009 010 public static boolean isValidCode(String q) { 011 return fromCode(q) != null; 012 } 013 014 public static HtmlInMarkdownCheck fromCode(String q) { 015 if (Utilities.noString(q)) { 016 return null; 017 } 018 q = q.toLowerCase(); 019 if (Utilities.existsInList(q, "n", "none", "ignore", "i")) { 020 return NONE; 021 } 022 if (Utilities.existsInList(q, "w", "warning", "warnings", "warn")) { 023 return WARNING; 024 } 025 if (Utilities.existsInList(q, "e", "error", "errors", "err")) { 026 return ERROR; 027 } 028 return null; 029 } 030}