public NSURLProperties() { data = new NSMutableDictionary<>(); } /*<bind>*/static { Bro.bind(NSURLProperties.class); }/*</bind>*/
public HKMetadata() { this.data = new NSMutableDictionary<>(); } /*<bind>*/static { Bro.bind(HKMetadata.class); }/*</bind>*/
public UIMotionEffectViewerOffsetValues() { this.data = new NSMutableDictionary<>(); } /*<bind>*/static { Bro.bind(UIMotionEffectViewerOffsetValues.class); }/*</bind>*/
public NSDictionaryWrapper() { this.data = new NSMutableDictionary<>(); }
@Override public Preferences getPreferences (String name) { File libraryPath = new File(System.getenv("HOME"), "Library"); File finalPath = new File(libraryPath, name + ".plist"); @SuppressWarnings("unchecked") NSMutableDictionary<NSString, NSObject> nsDictionary = (NSMutableDictionary<NSString, NSObject>)NSMutableDictionary .read(finalPath); // if it fails to get an existing dictionary, create a new one. if (nsDictionary == null) { nsDictionary = new NSMutableDictionary<NSString, NSObject>(); nsDictionary.write(finalPath, false); } return new IOSPreferences(nsDictionary, finalPath.getAbsolutePath()); }
@Override public Preferences getPreferences (String name) { File libraryPath = new File(System.getenv("HOME"), "Library"); File finalPath = new File(libraryPath, name + ".plist"); @SuppressWarnings("unchecked") NSMutableDictionary<NSString, NSObject> nsDictionary = (NSMutableDictionary<NSString, NSObject>)NSMutableDictionary .read(finalPath); // if it fails to get an existing dictionary, create a new one. if (nsDictionary == null) { nsDictionary = new NSMutableDictionary<NSString, NSObject>(); nsDictionary.write(finalPath, false); } return new IOSPreferences(nsDictionary, finalPath.getAbsolutePath()); }
public static <V extends NSObject> NSMutableDictionary<NSString, V> fromStringMap (Map<String, V> map) { NSMutableDictionary<NSString, V> dictionary = new NSMutableDictionary<>(); for (Map.Entry<String, V> entry : map.entrySet()) { dictionary.put(new NSString(entry.getKey()), entry.getValue()); } return dictionary; }
private static long create(Map<String, ?> textures) { NSDictionary<NSString, ?> properties = new NSMutableDictionary<>(); for (Map.Entry<String, ?> entry : textures.entrySet()) { NSString key = new NSString(entry.getKey()); NSObject value = null; if (entry.getValue() instanceof String) { value = new NSString((String)entry.getValue()); } else if (entry.getValue() instanceof NSURL || entry.getValue() instanceof UIImage || entry.getValue() instanceof NSString) { value = (NSObject)entry.getValue(); } else { throw new IllegalArgumentException("Only String, NSURL, UIImage or NSString are allowed!"); } properties.put(key, value); } return create(properties); } /*<properties>*/
@MarshalsPointer public static long toNative(Map<SCNParticleProperty, SCNParticlePropertyController> o, long flags) { if (o == null) { return 0L; } NSDictionary<NSString, SCNParticlePropertyController> dict = new NSMutableDictionary<>(); for (Map.Entry<SCNParticleProperty, SCNParticlePropertyController> e : o.entrySet()) { dict.put(e.getKey().value(), e.getValue()); } return NSObject.Marshaler.toNative(dict, flags); } }
@MarshalsPointer public static long toNative(Map<String, String> l, long flags) { if (l == null) { return 0L; } NSDictionary<NSString, NSString> o = new NSMutableDictionary<>(); for (Map.Entry<String, String> e : l.entrySet()) { o.put(new NSString(e.getKey()), new NSString(e.getValue())); } return NSObject.Marshaler.toNative(o, flags); } }
@MarshalsPointer public static long toNative(Map<String, List<String>> l, long flags) { if (l == null) { return 0L; } NSMutableDictionary<NSString, NSArray<NSString>> dict = new NSMutableDictionary<>(); for (Map.Entry<String, List<String>> e : l.entrySet()) { dict.put(new NSString(e.getKey()), NSArray.fromStrings(e.getValue())); } return NSObject.Marshaler.toNative(dict, flags); } }
@MarshalsPointer public static long toNative(Map<SCNRenderingTransform, CATransform3D> o, long flags) { if (o == null) { return 0L; } NSDictionary<NSString, NSValue> dict = new NSMutableDictionary<>(); for (Map.Entry<SCNRenderingTransform, CATransform3D> e : o.entrySet()) { dict.put(e.getKey().value(), NSValue.valueOf(e.getValue())); } return NSObject.Marshaler.toNative(dict, flags); } }
@MarshalsPointer public static long toNative(Map<SCNShaderModifierEntryPoint, String> o, long flags) { if (o == null) { return 0L; } NSDictionary<NSString, NSString> dict = new NSMutableDictionary<>(); for (Map.Entry<SCNShaderModifierEntryPoint, String> e : o.entrySet()) { dict.put(e.getKey().value(), new NSString(e.getValue())); } return NSObject.Marshaler.toNative(dict, flags); } }
return 0L; NSDictionary<NSString, NSNumber> o = new NSMutableDictionary<>(); for (Map.Entry<String, Number> e : l.entrySet()) { Number value = e.getValue();
} else if (o instanceof Map) { Map<?, ?> m = (Map<?, ?>) o; NSDictionary<NSString, NSString> d = new NSMutableDictionary<>(); for (Map.Entry<?, ?> e : m.entrySet()) { d.put(new NSString(e.getKey().toString()), new NSString(e.getValue().toString()));
/** * @since Available in iOS 4.0 and later. */ public AVVideoSettings setPixelAspectRatio(AVPixelAspectRatio pixelAspectRatio) { NSDictionary<NSString, NSObject> val = new NSMutableDictionary<>(); val.put(AVPixelAspectRatio.HorizontalSpacing(), pixelAspectRatio.getHorizontalSpacing()); val.put(AVPixelAspectRatio.VerticalSpacing(), pixelAspectRatio.getVerticalSpacing()); set(Keys.PixelAspectRatio(), val); return this; }
/** * @since Available in iOS 4.0 and later. */ public AVPixelBufferAttributes setPixelAspectRatio(AVPixelAspectRatio pixelAspectRatio) { NSDictionary<NSString, NSObject> val = new NSMutableDictionary<>(); val.put(AVPixelAspectRatio.HorizontalSpacing(), pixelAspectRatio.getHorizontalSpacing()); val.put(AVPixelAspectRatio.VerticalSpacing(), pixelAspectRatio.getVerticalSpacing()); data.put(AVVideoSettings.Keys.PixelAspectRatio(), val); return this; } /**
public static <V extends NSObject> NSMutableDictionary<NSString, V> fromStringMap (Map<String, V> map) { NSMutableDictionary<NSString, V> dictionary = new NSMutableDictionary<>(); for (Map.Entry<String, V> entry : map.entrySet()) { dictionary.put(new NSString(entry.getKey()), entry.getValue()); } return dictionary; }
@MarshalsPointer public static long toNative(Map<String, String> l, long flags) { if (l == null) { return 0L; } NSDictionary<NSString, NSString> o = new NSMutableDictionary<>(); for (Map.Entry<String, String> e : l.entrySet()) { o.put(new NSString(e.getKey()), new NSString(e.getValue())); } return NSObject.Marshaler.toNative(o, flags); } }
@MarshalsPointer public static long toNative(Map<String, List<String>> l, long flags) { if (l == null) { return 0L; } NSMutableDictionary<NSString, NSArray<NSString>> dict = new NSMutableDictionary<>(); for (Map.Entry<String, List<String>> e : l.entrySet()) { dict.put(new NSString(e.getKey()), NSArray.fromStrings(e.getValue())); } return NSObject.Marshaler.toNative(dict, flags); } }