Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1edab71d authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Unifying toString() method for various ItemInfo subclasses

Change-Id: I7cde42f0df412e2877fb93c77e74ee56a25edead
parent 35908f9e
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -125,11 +125,8 @@ public class AppInfo extends ItemInfo {
    }

    @Override
    public String toString() {
        return "ApplicationInfo(title=" + title + " id=" + this.id
                + " type=" + this.itemType + " container=" + this.container
                + " screen=" + screenId + " cellX=" + cellX + " cellY=" + cellY
                + " spanX=" + spanX + " spanY=" + spanY + " user=" + user + ")";
    protected String dumpProperties() {
        return super.dumpProperties() + " componentName=" + componentName;
    }

    /**
+0 −8
Original line number Diff line number Diff line
@@ -126,14 +126,6 @@ public class FolderInfo extends ItemInfo {
        public void onItemsChanged(boolean animate);
    }

    @Override
    public String toString() {
        return "FolderInfo(id=" + this.id + " type=" + this.itemType
                + " container=" + this.container + " screen=" + screenId
                + " cellX=" + cellX + " cellY=" + cellY + " spanX=" + spanX
                + " spanY=" + spanY + ")";
    }

    public boolean hasOption(int optionFlag) {
        return (options & optionFlag) != 0;
    }
+18 −4
Original line number Diff line number Diff line
@@ -189,10 +189,24 @@ public class ItemInfo {
    }

    @Override
    public String toString() {
        return "Item(id=" + this.id + " type=" + this.itemType + " container=" + this.container
            + " screen=" + screenId + " cellX=" + cellX + " cellY=" + cellY + " spanX=" + spanX
            + " spanY=" + spanY + " user=" + user + ")";
    public final String toString() {
        return getClass().getSimpleName() + "(" + dumpProperties() + ")";
    }

    protected String dumpProperties() {
        return "id=" + id
                + " type=" + itemType
                + " container=" + container
                + " screen=" + screenId
                + " cellX=" + cellX
                + " cellY=" + cellY
                + " spanX=" + spanX
                + " spanY=" + spanY
                + " minSpanX=" + minSpanX
                + " minSpanY=" + minSpanY
                + " rank=" + rank
                + " user=" + user
                + " title=" + title;
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -143,8 +143,8 @@ public class LauncherAppWidgetInfo extends ItemInfo {
    }

    @Override
    public String toString() {
        return "AppWidget(id=" + Integer.toString(appWidgetId) + ")";
    protected String dumpProperties() {
        return super.dumpProperties() + " appWidgetId=" + appWidgetId;
    }

    public final boolean isWidgetIdAllocated() {
+5 −0
Original line number Diff line number Diff line
@@ -29,4 +29,9 @@ public class PendingAddItemInfo extends ItemInfo {
     * The component that will be created.
     */
    public ComponentName componentName;

    @Override
    protected String dumpProperties() {
        return super.dumpProperties() + " componentName=" + componentName;
    }
}
Loading