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

com.softicar.platform.common.string.plural.InternalIrregularPluralMap Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.string.plural;

import java.util.Map;
import java.util.TreeMap;

class InternalIrregularPluralMap {

	private static final InternalIrregularPluralMap INSTANCE = new InternalIrregularPluralMap();
	private final Map map;

	private InternalIrregularPluralMap() {

		this.map = new TreeMap<>();

		add("child", "children");
		add("hero", "heroes");
		add("leaf", "leaves");
		add("life", "lives");
		add("man", "men");
		add("woman", "women");
		add("settings", "settings");
		add("preferences", "preferences");
	}

	public static InternalIrregularPluralMap getInstance() {

		return INSTANCE;
	}

	public String get(String word) {

		return map.get(word.toLowerCase());
	}

	private void add(String singular, String plural) {

		map.put(singular.toLowerCase(), plural);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy