public final class DefinitionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <E> void |
addOrThrowIfExist(Set<E> set,
E element,
String message)
Add or throw a new Mapping exception if the element already exist in collection.
|
static void |
notEmpty(Collection<?> property,
String message)
Checks if parameter collection property is not null or empty otherwise throw a new Mapping
exception.
|
static void |
notEmpty(String property,
String message)
Checks if parameter string property is not null or empty otherwise throw a new Mapping
exception.
|
static void |
notNull(Object property,
String message)
Checks if parameter property is not null or throw a new Mapping exception.
|
public static void notNull(Object property, String message) throws MappingException
property
- checked property.message
- error message.MappingException
- if property is null.public static void notEmpty(String property, String message) throws MappingException
property
- checked property.message
- error message.MappingException
- if property is null or empty.public static void notEmpty(Collection<?> property, String message) throws MappingException
property
- checked property.message
- error message.MappingException
- if property is null or empty.public static <E> void addOrThrowIfExist(Set<E> set, E element, String message) throws MappingException
E
- element type.set
- collection where the element will be added.element
- the element to add.message
- the error message.MappingException
- if element already exist in collection.Copyright © 2015. All Rights Reserved.