public List<String> asStringList() { List<String> list = new ArrayList<>(); if (size() == 0) return list; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { list.add(str.toString()); } return list; }
/** * Use this method to convert a NSSet of NSString items to a Set of String items. * Elements of this NSASet must be of type NSString, otherwise an exception will be thrown. * @return * @throws UnsupportedOperationException when the set items are not of type NSString. */ public Set<String> asStringSet() { Set<String> set = new HashSet<>(); if (size() == 0) return set; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { set.add(str.toString()); } return set; }
public List<String> asStringList() { List<String> list = new ArrayList<>(); if (size() == 0) return list; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { list.add(str.toString()); } return list; }
public List<String> asStringList() { List<String> list = new ArrayList<>(); if (size() == 0) return list; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { list.add(str.toString()); } return list; }
/** * Use this method to convert a NSSet of NSString items to a Set of String items. * Elements of this NSASet must be of type NSString, otherwise an exception will be thrown. * @return * @throws UnsupportedOperationException when the set items are not of type NSString. */ public Set<String> asStringSet() { Set<String> set = new HashSet<>(); if (size() == 0) return set; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { set.add(str.toString()); } return set; }
/** * Use this method to convert a NSSet of NSString items to a Set of String items. * Elements of this NSASet must be of type NSString, otherwise an exception will be thrown. * @return * @throws UnsupportedOperationException when the set items are not of type NSString. */ public Set<String> asStringSet() { Set<String> set = new HashSet<>(); if (size() == 0) return set; if (!(any() instanceof NSString)) throw new UnsupportedOperationException("items must be of type NSString"); for (T str : this) { set.add(str.toString()); } return set; }