Commit caa6983d authored by R.W.Majeed's avatar R.W.Majeed
Browse files

implemented equals(Object)

parent b713d365
......@@ -32,6 +32,7 @@ import java.time.temporal.TemporalAccessor;
import java.time.temporal.TemporalField;
import java.time.temporal.TemporalUnit;
import java.util.Date;
import java.util.Objects;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
......@@ -288,4 +289,15 @@ public class DateTimeAccuracy implements Temporal, Comparable<DateTimeAccuracy>
public int compareTo(DateTimeAccuracy o) {
return dateTime.compareTo(o.dateTime);
}
@Override
public boolean equals(Object other){
Objects.requireNonNull(other);
if( other.getClass() != DateTimeAccuracy.class )return false;
DateTimeAccuracy o = (DateTimeAccuracy)other;
if( !o.accuracy.equals(this.accuracy) )return false;
return dateTime.equals(o.dateTime);
}
// TODO implement hashCode
}
package de.sekmi.histream;
import java.text.ParsePosition;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.ResolverStyle;
import java.time.temporal.ChronoField;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAccessor;
import java.time.temporal.TemporalField;
import org.junit.Assert;
import org.junit.Test;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment