MessageMetaArray

@objc(SBDMessageMetaArray)
public class MessageMetaArray : NSObject, Codable, NSCopying
extension MessageMetaArray: Serializable

The MessageMetaArray instance has a string type of key and an array type of value.

The value consists of a string. It usually can be used for ‘vote’ or ‘reaction’ for the message.

  • key

    A string type of key.

    Since

    3.0.148

    Declaration

    Swift

    @objc
    public internal(set) var key: String { get }
  • The value consists of a string. The value guarantees de-duplicated string.

    Since

    3.0.148

    Declaration

    Swift

    @objc
    public internal(set) var value: [String] { get }
  • Initializes an message meta array with the given key and an empty array of the value.

    Since

    3.0.148

    Declaration

    Swift

    @objc
    public convenience init(key: String)

    Parameters

    key

    A string type of key.

    Return Value

    Message meta array instance.

  • Initializes an message meta array with the given key and the given value.

    Since

    3.0.148

    Declaration

    Swift

    @objc
    public init(key: String, value: [String]?)

    Parameters

    key

    A string type of key.

    value

    The value consists of a string.

    Return Value

    Message meta array instance.

  • Adds an set type of the value to the receiver’s value field.

    Since

    3.0.148

    Declaration

    Swift

    @objc
    public func addValue(_ value: Set<String>)

    Parameters

    value

    String set.

  • Adds an array type of the value to the receiver’s value field.

    Since

    3.0.148

    Declaration

    Swift

    @objc(addValueWithArray:)
    public func addValue(with array: [String])

    Parameters

    array

    String array.

  • Removes an set type of the value from the receiver’s value field.

    Note

    Nonexistent string value are not ignored.

    Since

    3.0.148

    Declaration

    Swift

    @objc
    public func removeValue(_ value: Set<String>)

    Parameters

    value

    String set.

  • Removes an array type of the value from the receiver’s value field.

    Note

    Nonexistent string value are not ignored.

    Since

    3.0.148

    Declaration

    Swift

    @objc(removeValueWithArray:)
    public func removeValue(with array: [String])

    Parameters

    array

    String array.

  • Compares this object with given other object.

    Declaration

    Swift

    public override func isEqual(_ object: Any?) -> Bool

    Parameters

    object

    Any instance

    Return Value

    true if same otherwise false

  • Copies this object

    Declaration

    Swift

    @objc
    public func copy(with zone: NSZone? = nil) -> Any

    Parameters

    zone

    optional NSZone

    Return Value

    MessageMetaArray instance

  • Serializes this object into data

    Declaration

    Swift

    @objc
    public func serialize() -> Data?

    Return Value

    optioanal Data instance

  • Deserializes and reconstructs the object

    Declaration

    Swift

    @objc
    public class func build(fromSerializedData data: Data?) -> `Self`?

    Parameters

    data

    Data instance

    Return Value

    MessageMetaArray if parameter is valid, otherwise nil