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

devutility.internal.lang.models.EntityFieldUtils Maven / Gradle / Ivy

There is a newer version: 1.3.8.1
Show newest version
package devutility.internal.lang.models;

import java.util.List;

import devutility.internal.util.CollectionUtils;

public class EntityFieldUtils {
	public static List includeEntityFields(List entityFields, List includeFields) {
		if (CollectionUtils.isNullOrEmpty(entityFields) || CollectionUtils.isNullOrEmpty(includeFields)) {
			return entityFields;
		}

		return CollectionUtils.list(entityFields, i -> i.getField() != null && includeFields.contains(i.getField().getName()));
	}

	public static List excludeEntityFields(List entityFields, List excludeFields) {
		if (CollectionUtils.isNullOrEmpty(entityFields) || CollectionUtils.isNullOrEmpty(excludeFields)) {
			return entityFields;
		}

		return CollectionUtils.list(entityFields, i -> i.getField() != null && !excludeFields.contains(i.getField().getName()));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy