All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smartdevicelink.proxy.rpc.DisplayCapability Maven / Gradle / Ivy

package com.smartdevicelink.proxy.rpc;

import com.smartdevicelink.proxy.RPCStruct;

import java.util.Hashtable;
import java.util.List;

/**
 * Contain the display related information and all windows related to that display.
 *
 * @since 6.0
 */
public class DisplayCapability extends RPCStruct {
    public static final String KEY_DISPLAY_NAME = "displayName";
    public static final String KEY_WINDOW_TYPE_SUPPORTED = "windowTypeSupported";
    public static final String KEY_WINDOW_CAPABILITIES = "windowCapabilities";

    public DisplayCapability() {
    }

    public DisplayCapability(Hashtable hash) {
        super(hash);
    }

    /**
     * Get the name of the display
     *
     * @return the name of the display
     */
    public String getDisplayName() {
        return getString(KEY_DISPLAY_NAME);
    }

    /**
     * Set the name of the display
     * {@code displayName.length() > 1}
     *
     * @param displayName the name of the display
     */
    public DisplayCapability setDisplayName(String displayName) {
        setValue(KEY_DISPLAY_NAME, displayName);
        return this;
    }

    /**
     * Sets the windowTypeSupported portion of the DisplayCapability class.
     * {@code windowTypeSupported.size()>=1}
     *
     * @param windowTypeSupported It informs the application how many windows the app is allowed to create per type.
     */
    public DisplayCapability setWindowTypeSupported(List windowTypeSupported) {
        setValue(KEY_WINDOW_TYPE_SUPPORTED, windowTypeSupported);
        return this;
    }

    /**
     * Gets the windowTypeSupported portion of the DisplayCapability class
     *
     * @return List
     * It informs the application how many windows the app is allowed to create per type.
     */
    @SuppressWarnings("unchecked")
    public List getWindowTypeSupported() {
        return (List) getObject(WindowTypeCapabilities.class, KEY_WINDOW_TYPE_SUPPORTED);
    }

    /**
     * Sets the windowCapabilities portion of the DisplayCapability class.
     *
     * @param windowCapabilities Contains a list of capabilities of all windows related to the app.
     *                           Once the app has registered the capabilities of all windows are provided.
     *                           GetSystemCapability still allows requesting window capabilities of all windows.
     *                           After registration, only windows with capabilities changed will be included.
     *                           Following cases will cause only affected windows to be included:
     *                           1. App creates a new window. After the window is created, a system capability notification will be sent related only to the created window.
     *                           2. App sets a new template to the window. The new template changes window capabilities. The notification will reflect those changes to the single window.
     */
    public DisplayCapability setWindowCapabilities(List windowCapabilities) {
        setValue(KEY_WINDOW_CAPABILITIES, windowCapabilities);
        return this;
    }

    /**
     * Gets the windowCapabilities portion of the DisplayCapability class
     *
     * @return List
     * Contains a list of capabilities of all windows related to the app.
     */
    @SuppressWarnings("unchecked")
    public List getWindowCapabilities() {
        return (List) getObject(WindowCapability.class, KEY_WINDOW_CAPABILITIES);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy