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

se.michaelthelin.spotify.enums.Action Maven / Gradle / Ivy

There is a newer version: 9.0.0-RC1
Show newest version
package se.michaelthelin.spotify.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * An enumeration of all possible {@link Action} types.
 *
 * @see Disallows object
 */
public enum Action {

  INTERRUPTING_PLAYBACK("interrupting_playback"),
  PAUSING("pausing"),
  RESUMING("resuming"),
  SEEKING("seeking"),
  SKIPPING_NEXT("skipping_next"),
  SKIPPING_PREV("skipping_prev"),
  TOGGLING_REPEAT_CONTEXT("toggling_repeat_context"),
  TOGGLING_SHUFFLE("toggling_shuffle"),
  TOGGLING_REPEAT_TRACK("toggling_repeat_track"),
  TRANSFERRING_PLAYBACK("transferring_playback");

  private static final Map map = new HashMap<>();

  static {
    for (Action action : Action.values()) {
      map.put(action.key, action);
    }
  }

  public final String key;

  Action(final String key) {
    this.key = key;
  }

  public static Action keyOf(String key) {
    return map.get(key);
  }

  /**
   * Get the {@link Action} key as a string.
   *
   * @return {@link Action} key as string.
   */
  public String getKey() {
    return key;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy