se.michaelthelin.spotify.enums.Modality Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spotify-web-api-java Show documentation
Show all versions of spotify-web-api-java Show documentation
A Java client for Spotify's Web API
package se.michaelthelin.spotify.enums;
import java.util.HashMap;
import java.util.Map;
/**
* An enumeration with the two modality types.
*
* @see Wikipedia: Mode (Music)
*/
public enum Modality {
MAJOR(1),
MINOR(0);
private static final Map map = new HashMap<>();
static {
for (Modality modality : Modality.values()) {
map.put(modality.mode, modality);
}
}
public final int mode;
Modality(final int mode) {
this.mode = mode;
}
public static Modality keyOf(int mode) {
return map.get(mode);
}
/**
* Get the {@link Modality} type as a string.
*
* @return {@link Modality} type as a string.
*/
public int getType() {
return this.mode;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy