Class CNContactFormatter

  • All Implemented Interfaces:
    NSCoding, NSCopying, NSSecureCoding, NSObject

    public class CNContactFormatter
    extends NSFormatter
    implements NSSecureCoding
    Formats a contact name. This formatter handles international ordering and delimiting of the contact name components. This includes applying the user defaults when appropriate.
    • Constructor Detail

      • CNContactFormatter

        protected CNContactFormatter​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static CNContactFormatter allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • attributedStringFromContactStyleDefaultAttributes

        @Nullable
        public static @Nullable NSAttributedString attributedStringFromContactStyleDefaultAttributes​(@NotNull
                                                                                                     @NotNull CNContact contact,
                                                                                                     long style,
                                                                                                     @Nullable
                                                                                                     @Nullable NSDictionary<?,​?> attributes)
        Formats the contact name returning an attributed string. This behaves like +stringFromContact:style: except it returns an attributed string. Includes the attribute key CNContactPropertyAttribute.
        Parameters:
        contact - The contact whose name is to be formatted.
        style - The formatting style to be used for the contact name.
        attributes - The default attributes to use. See NSFormatter for details.
        Returns:
        The formatted contact name as an attributed string.
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • delimiterForContact

        @NotNull
        public static @NotNull java.lang.String delimiterForContact​(@NotNull
                                                                    @NotNull CNContact contact)
        The recommended delimiter to use between name components for a given contact.
      • description_static

        public static java.lang.String description_static()
      • descriptorForRequiredKeysForStyle

        @NotNull
        public static @NotNull CNKeyDescriptor descriptorForRequiredKeysForStyle​(long style)
        The contact key descriptor required for the formatter. Use to fetch all contact keys required for the formatter style. Can combine key descriptors for different formatter styles in the fetch.
        Parameters:
        style - The formatting style to be used for the contact name.
        Returns:
        The contact key descriptor for the formatting style.
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • nameOrderForContact

        public static long nameOrderForContact​(@NotNull
                                               @NotNull CNContact contact)
        The recommended name order for a given contact.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • stringFromContactStyle

        @Nullable
        public static @Nullable java.lang.String stringFromContactStyle​(@NotNull
                                                                        @NotNull CNContact contact,
                                                                        long style)
        Formats the contact name.
        Parameters:
        contact - The contact whose name is to be formatted.
        style - The formatting style to be used for the contact name.
        Returns:
        The formatted contact name.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • attributedStringFromContactDefaultAttributes

        @Nullable
        public @Nullable NSAttributedString attributedStringFromContactDefaultAttributes​(@NotNull
                                                                                         @NotNull CNContact contact,
                                                                                         @Nullable
                                                                                         @Nullable NSDictionary<?,​?> attributes)
        Formats the contact name returning an attributed string. This behaves like -stringFromContact:style: except it returns an attributed string. CNContactPropertyAttribute key has the value of a CNContact name property key.
        Parameters:
        contact - The contact whose name is to be formatted.
        attributes - The default attributes to use. See NSFormatter for details.
        Returns:
        The formatted contact name as an attributed string.
      • setStyle

        public void setStyle​(long value)
        The style for a contact formatter instance. The default value is CNContactFormatterStyleFullName.
      • stringFromContact

        @Nullable
        public @Nullable java.lang.String stringFromContact​(@NotNull
                                                            @NotNull CNContact contact)
        Formats the contact name.
        Parameters:
        contact - The contact whose name is to be formatted.
        Returns:
        The formatted contact name.
      • style

        public long style()
        The style for a contact formatter instance. The default value is CNContactFormatterStyleFullName.
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • descriptorForRequiredKeysForDelimiter

        @NotNull
        public static @NotNull CNKeyDescriptor descriptorForRequiredKeysForDelimiter()
        The contact key descriptor required for the name delimiter. Use to fetch all contact keys required for +delimiterForContact:. Can combine key descriptors for different formatter styles in the fetch.
        Returns:
        The contact key descriptor for the name delimiter.
      • descriptorForRequiredKeysForNameOrder

        @NotNull
        public static @NotNull CNKeyDescriptor descriptorForRequiredKeysForNameOrder()
        The contact key descriptor required for the name order. Use to fetch all contact keys required for +nameOrderForContact:. Can combine key descriptors for different formatter styles in the fetch.
        Returns:
        The contact key descriptor for the name order.
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.