* @param activityMessage Message
* @param activityType Type
* @param activityUser User instance
- * @param activityTimestamp imestamp
+ * @param activityTimestamp Timestamp
*/
public UserActivityLog (final String activityMessage, final String activityType, final User activityUser, final Date activityTimestamp) {
// Call other constructor
* <p>
* @param activityType Type
* @param activityUser User instance
- * @param activityTimestamp imestamp
+ * @param activityTimestamp Timestamp
*/
public UserActivityLog (final String activityType, final User activityUser, final Date activityTimestamp) {
+ // Invoke oher constructor
+ this();
+
// Make sure all is set
if (null == activityType) {
// Throw NPE
// Call other constructor
this(activityMessage, activityType, activityUser, activityTimestamp);
+ // Validater parameter
+ if (null == principalName) {
+ // Throw NPE
+ throw new NullPointerException("principalName is null"); //NOI18N
+ } else if (principalName.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("principalName is empty"); //NOI18N
+ }
+
// Set principal name
this.activityPrincipalName = principalName;
}
// Call other constructor
this(activityType, activityUser, activityTimestamp);
+ // Validater parameter
+ if (null == principalName) {
+ // Throw NPE
+ throw new NullPointerException("principalName is null"); //NOI18N
+ } else if (principalName.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("principalName is empty"); //NOI18N
+ }
+
// Set principal name
this.activityPrincipalName = principalName;
}