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

org.exparity.beans.naming.AbstractNamingStrategy Maven / Gradle / Ivy

Go to download

A Java library of bean utilities for manipulating and inspecting Java classes implementing the Java Beans standard

There is a newer version: 1.0.3
Show newest version
/*
 * Copyright (c) Modular IT Limited.
 */

package org.exparity.beans.naming;

import static org.exparity.beans.Type.type;

import java.util.Collection;
import java.util.Map;

import org.exparity.beans.BeanNamingStrategy;
import org.exparity.beans.Type;

/**
 * @author Stewart Bissett
 */
public abstract class AbstractNamingStrategy implements BeanNamingStrategy {

	protected String typeName(final Class klass) {
		Type type = type(klass);
		if (type.is(Map.class)) {
			return "Map";
		} else if (type.is(Collection.class)) {
			return "Collection";
		} else {
			return type.componentSimpleName();
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy