summaryrefslogtreecommitdiff
path: root/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonEventMode.java
blob: 33f1f0f49751e43d0a48bc683e3903261690cedb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.smartdevicelink.proxy.rpc.enums;

/**
 * Indicates whether the button was depressed or released. A BUTTONUP event will
 * always be preceded by a BUTTONDOWN event
 * 
 * @see SoftButtonCapabilities
 * @see OnButtonEvent
 * @since SmartDeviceLink 1.0
 */
public enum ButtonEventMode {
	/**
	 * The button was released
	 */
	BUTTONUP,
	/**
	 * The button was depressed
	 */
	BUTTONDOWN;

	/**
	 * Returns a ButtonEventMode (BUTTONUP or BUTTONDOWN)
	 * 
	 * @param value
	 *            a String
	 * @return ButtonEventMode -BUTTONUP or BUTTONDOWN
	 */

    public static ButtonEventMode valueForString(String value) {
        try{
            return valueOf(value);
        }catch(Exception e){
            return null;
        }
    }
}