1 // © 2019 and later: Unicode, Inc. and others. 2 // License & terms of use: http://www.unicode.org/copyright.html 3 package org.unicode.icu.tool.cldrtoicu.regex; 4 5 import com.google.common.base.Ascii; 6 7 /** Instructions in result specifications (e.g. "values=..." or "fallback=..."). */ 8 enum Instruction { 9 /** Defines processing and transformation of CLDR values. */ 10 VALUES, 11 /** Defines fallback values to be used if no result was matched in a resource bundle. */ 12 FALLBACK, 13 /** Defines an xpath used to hack result equality to make deduplication work. */ 14 BASE_XPATH, 15 // TODO: Figure out how to remove this hack (probably by supporting partial matches). 16 /** 17 * Defines whether result values should be appended one at a time to a resource bundle 18 * (default) or grouped into a separate array. 19 */ 20 GROUP; 21 22 /** Returns the instruction enum for its ID as it appears in the configuration file. */ forId(String id)23 static Instruction forId(String id) { 24 return Instruction.valueOf(Ascii.toUpperCase(id)); 25 } 26 } 27