File indexing completed on 2024-12-22 04:41:40

0001 /*
0002  * SPDX-FileCopyrightText: 2016 Thomas Posch <kdeconnect@online.posch.name>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 package org.kde.kdeconnect.Plugins.RunCommandPlugin;
0008 
0009 import androidx.annotation.NonNull;
0010 
0011 import org.json.JSONException;
0012 import org.json.JSONObject;
0013 import org.kde.kdeconnect.UserInterface.List.EntryItem;
0014 
0015 class CommandEntry extends EntryItem {
0016     private final String key;
0017 
0018     public CommandEntry(@NonNull JSONObject o) throws JSONException {
0019         this(o.getString("name"), o.getString("command"), o.getString("key"));
0020     }
0021 
0022     public CommandEntry(String name, String cmd, String key) {
0023         super(name, cmd);
0024         this.key = key;
0025     }
0026 
0027     public String getKey() {
0028         return key;
0029     }
0030 
0031     public String getName() {
0032         return title;
0033     }
0034 
0035     public String getCommand() {
0036         return subtitle;
0037     }
0038 }