public static NSSet<NSString> fromStrings (Collection<String> strings) { NSString[] nsStrings = new NSString[strings.size()]; int i = 0; for (String s : strings) { nsStrings[i] = new NSString(s); i++; } return new NSSet<NSString>(nsStrings); }
public static String addPercentEncoding(String str, NSCharacterSet allowedCharacters) { long handle = create(getChars(str), str.length()); return addPercentEncoding(handle, sel_stringByAddingPercentEncodingWithAllowedCharacters$, allowedCharacters); }
public static String addPercentEscapes(String str, NSStringEncoding encoding) { long handle = create(getChars(str), str.length()); return addPercentEscapes(handle, sel_stringByAddingPercentEscapesUsingEncoding$, encoding); }
public static String encodeURLString(String urlString, NSStringEncoding encoding) { return new NSString(urlString).addPercentEscapes(encoding); } public static String decodeURLString(String urlString, NSStringEncoding encoding) {
public static String appendPathComponent(String str, String component) { long handle = create(getChars(str), str.length()); return appendPathComponent(handle, sel_stringByAppendingPathComponent$, component); }
public static /*<name>*/MPMediaPlaylistProperty/*</name>*/ valueOf(/*<type>*/NSString/*</type>*/ value) { for (/*<name>*/MPMediaPlaylistProperty/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/MPMediaPlaylistProperty/*</name>*/.class.getName()); }
public static String appendPathExtension(String str, String extension) { long handle = create(getChars(str), str.length()); return appendPathExtension(handle, sel_stringByAppendingPathExtension$, extension); }
@Override public String toString() { int len = (int) length(); if (len == 0) { return EMPTY_STRING; } char[] chars = new char[len]; getCharacters(VM.getArrayValuesAddress(chars), new NSRange(0, len)); return VM.newStringNoCopy(chars, 0, len); }
@WeaklyLinked public CFType getAttribute(long loc, NSAttributedStringAttribute attrName, CFRange effectiveRange) { if (attrName == null) { throw new NullPointerException("attrName"); } return getAttribute(loc, attrName.value().as(CFString.class), effectiveRange); } @WeaklyLinked
public static /*<name>*/AVMetadataKeyCommon/*</name>*/ valueOf(/*<type>*/NSString/*</type>*/ value) { for (/*<name>*/AVMetadataKeyCommon/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/AVMetadataKeyCommon/*</name>*/.class.getName()); }
public static String appendPathComponent(String str, String component) { long handle = create(getChars(str), str.length()); return appendPathComponent(handle, sel_stringByAppendingPathComponent$, component); }
public static String appendPathExtension(String str, String extension) { long handle = create(getChars(str), str.length()); return appendPathExtension(handle, sel_stringByAppendingPathExtension$, extension); }
@Override public String toString() { int len = (int) length(); if (len == 0) { return EMPTY_STRING; } char[] chars = new char[len]; getCharacters(VM.getArrayValuesAddress(chars), new NSRange(0, len)); return VM.newStringNoCopy(chars, 0, len); }
public static String encodeURLString(String urlString, NSStringEncoding encoding) { return new NSString(urlString).addPercentEscapes(encoding); } public static String decodeURLString(String urlString, NSStringEncoding encoding) {
@WeaklyLinked public CFType getAttribute(long loc, NSAttributedStringAttribute attrName, CFRange effectiveRange) { if (attrName == null) { throw new NullPointerException("attrName"); } return getAttribute(loc, attrName.value().as(CFString.class), effectiveRange); } @WeaklyLinked
/** * @since Available in iOS 8.0 and later. */ public HKMetadata setDigitalSignature(String signature) { put(HKMetadataKey.DigitalSignature, new NSString(signature)); return this; } /**
public static /*<name>*/NSRunLoopMode/*</name>*/ valueOf(/*<type>*/NSString/*</type>*/ value) { for (/*<name>*/NSRunLoopMode/*</name>*/ v : values) { if (v.value().equals(value)) { return v; } } throw new IllegalArgumentException("No constant with value " + value + " found in " + /*<name>*/NSRunLoopMode/*</name>*/.class.getName()); }