22
33package de .bytefish .pgbulkinsert .pgsql .model .range ;
44
5- import org .checkerframework .checker .nullness .qual .Nullable ;
6-
75import java .util .Objects ;
86
97// https://github.com/npgsql/npgsql/blob/d4132d0d546594629bcef658bcb1418b4a8624cc/src/Npgsql/NpgsqlTypes/NpgsqlRange.cs
108public class Range <TElementType > {
119
1210 private int flags ;
1311
14- @ Nullable
1512 private TElementType lowerBound ;
1613
17- @ Nullable
1814 private TElementType upperBound ;
1915
20- public Range (@ Nullable TElementType lowerBound , @ Nullable TElementType upperBound ) {
16+ public Range (TElementType lowerBound , TElementType upperBound ) {
2117 this (lowerBound , true , false , upperBound , true , false );
2218 }
2319
24- public Range (@ Nullable TElementType lowerBound , boolean lowerBoundIsInclusive , @ Nullable TElementType upperBound , boolean upperBoundIsInclusive ) {
20+ public Range (TElementType lowerBound , boolean lowerBoundIsInclusive , TElementType upperBound , boolean upperBoundIsInclusive ) {
2521 this (lowerBound , lowerBoundIsInclusive , false , upperBound , upperBoundIsInclusive , false );
2622 }
2723
28- public Range (@ Nullable TElementType lowerBound , boolean lowerBoundIsInclusive , boolean lowerBoundInfinite ,
29- @ Nullable TElementType upperBound , boolean upperBoundIsInclusive , boolean upperBoundInfinite ) {
24+ public Range (TElementType lowerBound , boolean lowerBoundIsInclusive , boolean lowerBoundInfinite ,
25+ TElementType upperBound , boolean upperBoundIsInclusive , boolean upperBoundInfinite ) {
3026 this (lowerBound , upperBound , evaluateBoundaryFlags (lowerBoundIsInclusive , upperBoundIsInclusive , lowerBoundInfinite , upperBoundInfinite ));
3127 }
3228
3329
34- private Range (@ Nullable TElementType lowerBound , @ Nullable TElementType upperBound , int flags ) {
30+ private Range (TElementType lowerBound , TElementType upperBound , int flags ) {
3531 this .lowerBound = (flags & RangeFlags .LowerBoundInfinite ) != 0 ? null : lowerBound ;
3632 this .upperBound = (flags & RangeFlags .UpperBoundInfinite ) != 0 ? null : upperBound ;
3733 this .flags = flags ;
@@ -52,7 +48,7 @@ private Range(@Nullable TElementType lowerBound, @Nullable TElementType upperBou
5248 }
5349 }
5450
55- private boolean isEmptyRange (@ Nullable TElementType lowerBound , @ Nullable TElementType upperBound , int flags ) {
51+ private boolean isEmptyRange (TElementType lowerBound , TElementType upperBound , int flags ) {
5652 // ---------------------------------------------------------------------------------
5753 // We only want to check for those conditions that are unambiguously erroneous:
5854 // 1. The bounds must not be default values (including null).
@@ -121,7 +117,6 @@ public boolean isUpperBoundInfinite() {
121117 return (flags & RangeFlags .UpperBoundInfinite ) != 0 ;
122118 }
123119
124- @ Nullable
125120 public TElementType getLowerBound () {
126121 return lowerBound ;
127122 }
@@ -130,7 +125,6 @@ public void setLowerBound(TElementType lowerBound) {
130125 this .lowerBound = lowerBound ;
131126 }
132127
133- @ Nullable
134128 public TElementType getUpperBound () {
135129 return upperBound ;
136130 }
0 commit comments