TimetagUtil class abstract

Implementers

Constructors

TimetagUtil()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generateTimeTags<T>({required List<T> messages, required DateTime getMsgTime(T), required T onCreateTimeTag(DateTime time), required List<String> timeTagPolicies}) List<T>
Generate time tag amount messages if timeTagPolicies is "5m", "20m", "1h", "3h", is mean create a tag in 5min, 20min, 1hour and 3 hour, timeTagPolicies support {s,m,h,d} after that 3hours, create a time tag each 3 hours
mergeIncomeNewMessages<T>({required List<T> messages, required bool isAddTop, required List<T> addedMsgs, required DateTime getMsgTime(T msg), required bool isTimeTagMsg(T msg), required T onCreateTimeTag(DateTime time), required List<String> timeTagPolicies, required String getMsgId(T msg), bool needRegenerateTimeTag = false}) List<T>
  • Add addedMsgs into messages and remove duplicated messages
  • Generate time tag amount addedMsgs (keep time tag in messages not to change) if timeTagPolicies is "5m", "20m", "1h", "3h", is mean create a tag in 5min, 20min, 1hour and 3 hour, after that 3hours, create a time tag each 3 hours Notice, messsages and addedMsgs should be already ordered by time asc. It mean the function will not sort again
  • noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    parseTimeTagPolicies(List<String> timeTagPolicies) List<int>
    toString() String
    A string representation of this object.
    inherited

    Operators

    operator ==(Object other) bool
    The equality operator.
    inherited