<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: device.proto

namespace OS\PB\DeviceFormatAction;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.DeviceFormatAction.FormatMethodType</code>
 */
class FormatMethodType
{
    /**
     * Do nothing
     *
     * Generated from protobuf enum <code>FormatMethod_NotSet = 0;</code>
     */
    const FormatMethod_NotSet = 0;
    /**
     * Erases NOR Flash and initializes a new file system
     *
     * Generated from protobuf enum <code>FormatMethod_FileSystem = 1;</code>
     */
    const FormatMethod_FileSystem = 1;
    /**
     * Simply reinitializes the file system
     *
     * Generated from protobuf enum <code>FormatMethod_FileSystemQuick = 2;</code>
     */
    const FormatMethod_FileSystemQuick = 2;
    /**
     * Clears the settings from internal flash
     *
     * Generated from protobuf enum <code>FormatMethod_Settings = 3;</code>
     */
    const FormatMethod_Settings = 3;
    /**
     * Formats the file system and clears all settings like a new born
     *
     * Generated from protobuf enum <code>FormatMethod_FactoryDefault = 4;</code>
     */
    const FormatMethod_FactoryDefault = 4;

    private static $valueToName = [
        self::FormatMethod_NotSet => 'FormatMethod_NotSet',
        self::FormatMethod_FileSystem => 'FormatMethod_FileSystem',
        self::FormatMethod_FileSystemQuick => 'FormatMethod_FileSystemQuick',
        self::FormatMethod_Settings => 'FormatMethod_Settings',
        self::FormatMethod_FactoryDefault => 'FormatMethod_FactoryDefault',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

