NlsDurationFormatter (@NotNull MeasureUnit durationTimeUnit) { if ( durationTimeUnit != MeasureUnit.NANOSECOND && durationTimeUnit != MeasureUnit.MICROSECOND && durationTimeUnit != MeasureUnit.MILLISECOND && durationTimeUnit != MeasureUnit.SECOND && durationTimeUnit != MeasureUnit.MINUTE && durationTimeUnit != MeasureUnit.HOUR && durationTimeUnit != MeasureUnit.DAY ) { throw new IllegalArgumentException("The measurement must be a measurement of time"); } this.durationTimeUnit = durationTimeUnit; return this; }