* @param companyShortName Company short name
*/
public BusinessBasicData (final String companyShortName) {
+ // Call other constructor
+ this();
+
// First, validate all parameter
- if (companyShortName == null) {
+ if (null == companyShortName) {
// Is null
throw new NullPointerException("companyShortName is null"); //NOI18N
} else if (companyShortName.isEmpty()) {
@Enumerated (EnumType.STRING)
private JobPositionStatus jobPositionStatus;
+ /**
+ * Default constructor is for the entity manager
+ */
+ public EmployeePosition () {
+ }
+
+ /**
+ * Constructor with all mandatory entity properties
+ * <p>
+ * @param jobPositionName Job name
+ * @param jobPositionStart When the job starts
+ * @param jobPositionStatus Status of the job
+ */
+ public EmployeePosition (final String jobPositionName, final Date jobPositionStart, final JobPositionStatus jobPositionStatus) {
+ // Invoke simplier constructor
+ this();
+
+ // Validate all parameter
+ if (null == jobPositionName) {
+ // Throw NPE
+ throw new NullPointerException("Parameter 'jobPositionName' is null"); //NOI18N
+ } else if (jobPositionName.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("Parameter 'jobPositionName' is empty"); //NOI18N
+ } else if (null == jobPositionStart) {
+ // Throw NPE again
+ throw new NullPointerException("Parameter 'jobPositionStart' is null"); //NOI18N
+ } else if (null == jobPositionStatus) {
+ // Throw it again
+ throw new NullPointerException("Parameter 'jobPositionStatus' is null"); //NOI18N
+ }
+
+ // Set all parameter
+ this.jobPositionName = jobPositionName;
+ this.jobPositionStart = jobPositionStart;
+ this.jobPositionStatus = jobPositionStatus;
+ }
+
@Override
public int compareTo (final HireableJobPosition jobPosition) {
// Check parameter on null-reference and equality to this
// Init comparisons
final int[] comparators = {
- // First file name ...
// First file name ...
StringUtils.compareIgnoreCase(this.getLogoFileName(), logo.getLogoFileName()),
// ... then uploader instance
-UserUtils.compare(this.getLogoUploaderUser(), logo.getLogoUploaderUser())
+ UserUtils.compare(this.getLogoUploaderUser(), logo.getLogoUploaderUser())
};
// Check all values