Package org.pentaho.di.repository
Class RepositoryCommonValidations
- java.lang.Object
-
- org.pentaho.di.repository.RepositoryCommonValidations
-
public class RepositoryCommonValidations extends Object
- Author:
- Andrey Khayrutdinov
-
-
Constructor Summary
Constructors Constructor Description RepositoryCommonValidations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkUserInfo(IUser user)
Validatesuser
's data.static IUser
normalizeUserInfo(IUser user)
Normalizesuser
's data.
-
-
-
Method Detail
-
checkUserInfo
public static boolean checkUserInfo(IUser user)
Validatesuser
's data. Common rule for all repositories is: both login and name must contain at least one meaningful char.- Parameters:
user
- user- Returns:
true
if user's login and name are not empty- Throws:
NullPointerException
- isuser
isnull
-
normalizeUserInfo
public static IUser normalizeUserInfo(IUser user)
Normalizesuser
's data. According to common rules, simply trims login and name.- Parameters:
user
- user- Returns:
- normalized instance
- Throws:
NullPointerException
- ifuser
isnull
oruser
's login and name
-
-