tsp-output/@azure-tools/typespec-java/src/main/java/com/notificationhubs/models/ContentType.java
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.notificationhubs.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/** Defines values for ContentType. */
public enum ContentType {
    /** Enum value application/json;charset=utf-8. */
    APPLICATION_JSON_CHARSET_UTF_8("application/json;charset=utf-8"),

    /** Enum value application/xml;charset=utf-8. */
    APPLICATION_XML_CHARSET_UTF_8("application/xml;charset=utf-8"),

    /** Enum value application/octet-stream. */
    APPLICATION_OCTET_STREAM("application/octet-stream");

    /** The actual serialized value for a ContentType instance. */
    private final String value;

    ContentType(String value) {
        this.value = value;
    }

    /**
     * Parses a serialized value to a ContentType instance.
     *
     * @param value the serialized value to parse.
     * @return the parsed ContentType object, or null if unable to parse.
     */
    @JsonCreator
    public static ContentType fromString(String value) {
        if (value == null) {
            return null;
        }
        ContentType[] items = ContentType.values();
        for (ContentType item : items) {
            if (item.toString().equalsIgnoreCase(value)) {
                return item;
            }
        }
        return null;
    }

    /** {@inheritDoc} */
    @JsonValue
    @Override
    public String toString() {
        return this.value;
    }
}
