geary/test/engine/api/geary-email-identifier-mock.vala
Michael James Gratton dd3a7a1bc8 Add API for (de)serialising FolderPath and EmailIdentifier
Supports (de)serialising via GLib.Variant for use as GLib.Action targets
transmission via DBus, etc.
2019-04-17 09:06:24 +10:00

28 lines
707 B
Vala

/*
* Copyright 2017 Michael Gratton <mike@vee.net>
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
public class Geary.MockEmailIdentifer : EmailIdentifier {
private int id;
public MockEmailIdentifer(int id) {
base(id.to_string());
this.id = id;
}
public override int natural_sort_comparator(Geary.EmailIdentifier other) {
MockEmailIdentifer? other_mock = other as MockEmailIdentifer;
return (other_mock == null) ? 1 : this.id - other_mock.id;
}
public override GLib.Variant to_variant() {
return new GLib.Variant.int32(id);
}
}