19 namespace Deveel.Data.Sql.Objects {
21 private readonly TimeSpan?
value;
31 : this(0, hours, minutes, seconds) {
35 : this(days, hours, minutes, seconds, 0) {
38 public SqlDayToSecond(
int days,
int hours,
int minutes,
int seconds,
int milliseconds) {
39 value =
new TimeSpan(days, hours, minutes, seconds, milliseconds);
42 int IComparable.CompareTo(
object obj) {
46 int IComparable<ISqlObject>.CompareTo(
ISqlObject other) {
51 get {
return value == null; }
56 throw new NullReferenceException();
59 public double TotalMilliseconds {
62 return value.Value.TotalMilliseconds;
69 return value.Value.Days;
76 return value.Value.Hours;
83 return value.Value.Minutes;
90 return value.Value.Seconds;
94 public int Milliseconds {
97 return value.Value.Milliseconds;
106 if (IsNull && other.
IsNull)
108 if (!IsNull && other.
IsNull)
110 if (IsNull && !other.
IsNull)
113 return value.Value.CompareTo(other.
value.Value);
123 var result = value.Value.Add(ts);
124 return new SqlDayToSecond(result.Days, result.Hours, result.Minutes, result.Seconds, result.Milliseconds);
134 var result = value.Value.Subtract(ts);
135 return new SqlDayToSecond(result.Days, result.Hours, result.Minutes, result.Seconds, result.Milliseconds);
139 throw new NotImplementedException();
143 if (IsNull && other.
IsNull)
146 return value.Equals(other.
value);
149 public override bool Equals(
object obj) {
154 return value == null ? 0 : value.Value.GetHashCode();
SqlDayToSecond(int days, int hours, int minutes, int seconds)
int CompareTo(SqlDayToSecond other)
SqlDayToSecond(int days, int hours, int minutes, int seconds, int milliseconds)
override int GetHashCode()
SqlDayToSecond Add(SqlDayToSecond interval)
SqlDayToSecond Subtract(SqlDayToSecond interval)
Defines the contract for a valid SQL Object
bool IsComparableTo(ISqlObject other)
Checks if the current object is comparable with the given one.
bool Equals(SqlDayToSecond other)
override bool Equals(object obj)
SqlDayToSecond(bool isNull)
SqlDayToSecond(int hours, int minutes, int seconds)