public override Value AsValue() { // We need to check validity upfront without throwing exceptions, because the PageCursor might give garbage bytes if (TimeZones.validZoneOffset(ZoneOffsetSeconds)) { return(TimeValue.time(NanosOfDayUTC, ZoneOffset.ofTotalSeconds(ZoneOffsetSeconds))); } return(NO_VALUE); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void compareToSameAsValue() public virtual void CompareToSameAsValue() { Value[] values = new Value[] { TimeValue.time(9999, ZoneOffset.of("+18:00")), TimeValue.time(10000, ZoneOffset.of("-18:00")), TimeValue.time(10000, ZoneOffset.of("-00:00")), TimeValue.time(10000, ZoneOffset.of("+01:00")), TimeValue.time(10000, ZoneOffset.of("+03:00")), TimeValue.time(10000, ZoneOffset.of("-18:00")) }; ZonedTimeIndexKey keyI = new ZonedTimeIndexKey(); ZonedTimeIndexKey keyJ = new ZonedTimeIndexKey(); foreach (Value vi in values) { foreach (Value vj in values) { vi.WriteTo(keyI); vj.WriteTo(keyJ); int expected = Values.COMPARATOR.Compare(vi, vj); assertEquals(format("comparing %s and %s", vi, vj), expected, keyI.CompareValueTo(keyJ)); } } }
internal static Value AsValue(long long0, long long1) { OffsetTime time = AsValueRaw(long0, long1); return(time != null?TimeValue.time(time) : NO_VALUE); }