001package com.vonage.client.video;
002
003import com.fasterxml.jackson.annotation.JsonCreator;
004import com.fasterxml.jackson.annotation.JsonValue;
005
006/**
007 * Defines values used in the {@link Archive.Builder#outputMode(OutputMode)} method and returned by the
008 * {@link Archive#getOutputMode} method.
009 */
010public enum OutputMode {
011        /**
012         * All streams in the archive are recorded to a single (composed) file.
013         */
014        COMPOSED,
015        /**
016         * Each stream in the archive is recorded to its own individual file.
017         */
018        INDIVIDUAL;
019
020        @JsonValue
021        @Override
022        public String toString() {
023                return name().toLowerCase();
024        }
025
026        @JsonCreator
027        public static OutputMode fromString(String value) {
028                try {
029                        return OutputMode.valueOf(value.toUpperCase());
030                }
031                catch (NullPointerException | IllegalArgumentException ex) {
032                        return null;
033                }
034        }
035}