| OLD | NEW |
| (Empty) |
| 1 library java.engine; | |
| 2 | |
| 3 class StringUtilities { | |
| 4 static const String EMPTY = ''; | |
| 5 static const List<String> EMPTY_ARRAY = const <String> []; | |
| 6 static String intern(String s) => s; | |
| 7 static String substringBefore(String str, String separator) { | |
| 8 if (str == null || str.isEmpty) { | |
| 9 return str; | |
| 10 } | |
| 11 int pos = str.indexOf(separator); | |
| 12 if (pos < 0) { | |
| 13 return str; | |
| 14 } | |
| 15 return str.substring(0, pos); | |
| 16 } | |
| 17 } | |
| 18 | |
| 19 class FileNameUtilities { | |
| 20 static String getExtension(String fileName) { | |
| 21 if (fileName == null) { | |
| 22 return ""; | |
| 23 } | |
| 24 int index = fileName.lastIndexOf('.'); | |
| 25 if (index >= 0) { | |
| 26 return fileName.substring(index + 1); | |
| 27 } | |
| 28 return ""; | |
| 29 } | |
| 30 } | |
| 31 | |
| 32 class ArrayUtils { | |
| 33 static List addAll(List target, List source) { | |
| 34 List result = new List.from(target); | |
| 35 result.addAll(source); | |
| 36 return result; | |
| 37 } | |
| 38 } | |
| 39 | |
| 40 class UUID { | |
| 41 static int __nextId = 0; | |
| 42 final String id; | |
| 43 UUID(this.id); | |
| 44 String toString() => id; | |
| 45 static UUID randomUUID() => new UUID((__nextId).toString()); | |
| 46 } | |
| OLD | NEW |