<commit_before>/*******************************************************************************
 * Copyright (c) 2018 Red Hat Inc and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     <NAME> - initial implementation
 *******************************************************************************/
package org.eclipse.hono.util;

/**
 * Utility used to determine type of the endpoint.
 */
public enum EndpointType {
    TELEMETRY, EVENT, UNKNOWN;

    /**
     * Gets the endpoint type from a string value.
     * 
     * @param name The name of the endpoint type.
     * 
     * @return The enum literal of the endpoint type. Returns {@value #UNKNOWN} if it cannot find the endpoint type.
     *         Never returns {@code null}.
     */
    public static EndpointType fromString(String name) {
        switch (name) {
        case TelemetryConstants.TELEMETRY_ENDPOINT:
        case TelemetryConstants.TELEMETRY_ENDPOINT_SHORT:
            return TELEMETRY;
        case EventConstants.EVENT_ENDPOINT:
        case EventConstants.EVENT_ENDPOINT_SHORT:
            return EVENT;
        default:
            return UNKNOWN;
        }
    }
}<commit_msg>Use "link" to reference enum literal, fixing javadoc issue.<commit_after>/*******************************************************************************
 * Copyright (c) 2018 Red Hat Inc and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     <NAME> - initial implementation
 *******************************************************************************/
package org.eclipse.hono.util;

/**
 * Utility used to determine type of the endpoint.
 */
public enum EndpointType {
    TELEMETRY, EVENT, UNKNOWN;

    /**
     * Gets the endpoint type from a string value.
     * 
     * @param name The name of the endpoint type.
     * 
     * @return The enum literal of the endpoint type. Returns {@link #UNKNOWN} if it cannot find the endpoint type.
     *         Never returns {@code null}.
     */
    public static EndpointType fromString(String name) {
        switch (name) {
        case TelemetryConstants.TELEMETRY_ENDPOINT:
        case TelemetryConstants.TELEMETRY_ENDPOINT_SHORT:
            return TELEMETRY;
        case EventConstants.EVENT_ENDPOINT:
        case EventConstants.EVENT_ENDPOINT_SHORT:
            return EVENT;
        default:
            return UNKNOWN;
        }
    }
}
{'fraction_non_alphanumeric': 0.17949627527492018, 'fraction_numerical': 0.005675771550195104, 'mean_word_length': 3.017094017094017, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '934306', 'n_tokens_mistral': 721, 'n_tokens_neox': 675, 'n_words': 248}