]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
added constructors and made endTime/startTime not nullable
authorRoland Haeder <roland@mxchange.org>
Thu, 7 Apr 2016 10:34:21 +0000 (12:34 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 7 Apr 2016 10:38:15 +0000 (12:38 +0200)
src/org/mxchange/jcontactsbusiness/opening_times/BusinessOpeningTimes.java

index bffed5dac462926ecd42a01808077cb70fa14129..f11ea40ec95be4df47306b81c9b1b52a1b84308c 100644 (file)
@@ -56,7 +56,7 @@ public class BusinessOpeningTimes implements OpeningTimes {
         * Ending time (hh:mm)
         */
        @Basic (optional = false)
-       @Column (name = "opening_times_end_time")
+       @Column (name = "opening_times_end_time", nullable = false)
        @Temporal (TemporalType.TIME)
        private Calendar endTime;
 
@@ -80,10 +80,49 @@ public class BusinessOpeningTimes implements OpeningTimes {
         * Starting time (hh:mm)
         */
        @Basic (optional = false)
-       @Column (name = "opening_times_start_time")
+       @Column (name = "opening_times_start_time", nullable = false)
        @Temporal (TemporalType.TIME)
        private Calendar startTime;
 
+       /**
+        * Default constructor
+        */
+       public BusinessOpeningTimes () {
+       }
+
+       /**
+        * Constructor with all field
+        * <p>
+        * @param endDay    End day
+        * @param endTime   End time
+        * @param id        Id number
+        * @param startDay  Start day
+        * @param startTime Start time
+        */
+       public BusinessOpeningTimes (final DayOfWeek endDay, final Calendar endTime, final Long id, final DayOfWeek startDay, final Calendar startTime) {
+               // Call other constructor
+               this(endDay, endTime, startDay, startTime);
+
+               // Set id number
+               this.id = id;
+       }
+
+       /**
+        * Constructor with all fields except id number
+        * <p>
+        * @param endDay    End day
+        * @param endTime   End time
+        * @param startDay  Start day
+        * @param startTime Start time
+        */
+       public BusinessOpeningTimes (final DayOfWeek endDay, final Calendar endTime, final DayOfWeek startDay, final Calendar startTime) {
+               // Set all fields
+               this.endDay = endDay;
+               this.endTime = endTime;
+               this.startDay = startDay;
+               this.startTime = startTime;
+       }
+
        @Override
        public boolean equals (final Object obj) {
                if (this == obj) {