All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.liferay.layout.converter.BorderRadiusConverter Maven / Gradle / Ivy

There is a newer version: 50.2.0
Show newest version
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */

package com.liferay.layout.converter;

import com.liferay.portal.kernel.util.HashMapBuilder;

import java.util.Map;
import java.util.Objects;
import java.util.Set;

/**
 * @author Pablo Molina
 */
public class BorderRadiusConverter {

	public static final Map externalToInternalValuesMap =
		HashMapBuilder.put(
			"Circle", "rounded-circle"
		).put(
			"Large", "rounded-lg"
		).put(
			"Pill", "rounded-pill"
		).put(
			"Regular", "rounded"
		).build();

	public static String convertToExternalValue(String value) {
		Set externalValues = externalToInternalValuesMap.keySet();

		for (String externalValue : externalValues) {
			if (Objects.equals(
					value, externalToInternalValuesMap.get(externalValue))) {

				return externalValue;
			}
		}

		return null;
	}

	public static String convertToInternalValue(String label) {
		return externalToInternalValuesMap.get(label);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy