mirror of
				https://github.com/NativeScript/NativeScript.git
				synced 2025-11-04 12:58:38 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			672 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			672 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
export class Collections {
 | 
						|
    public static stringArrayToStringSet(str: string[]): any {
 | 
						|
        var hashSet = new java.util.HashSet();
 | 
						|
        if ("undefined" != typeof str) {
 | 
						|
            for (var element in str) {
 | 
						|
                hashSet.add('' + str[element]);
 | 
						|
            }
 | 
						|
        }
 | 
						|
        return hashSet;
 | 
						|
    }
 | 
						|
 | 
						|
    public static stringSetToStringArray(stringSet: any): string[] {
 | 
						|
        var arr = [];
 | 
						|
        if ("undefined" != typeof stringSet) {
 | 
						|
            var it = stringSet.iterator();
 | 
						|
            while (it.hasNext()) {
 | 
						|
                var element = '' + it.next();
 | 
						|
                arr.push(element);
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        return arr;
 | 
						|
    }
 | 
						|
} |