@Test(expected = NullPointerException.class) public void testGetSpatialUnitThrowsNPEIfSpaceNull() { AxisUtils.getSpatialUnit(null, unitService); }
public static <S extends AnnotatedSpace<C>, C extends CalibratedAxis> Optional<String> getSpatialUnit(final S space, final UnitService unitService) throws IllegalArgumentException { if (!hasSpatialDimensions(space)) { throw new IllegalArgumentException("Space has no spatial axes."); } if (!isUnitsConvertible(space, unitService)) { return Optional.empty(); } final String unit = space.axis(0).unit(); return unit == null ? Optional.of("") : Optional.of(unit); }
AxisUtils { public static <S extends AnnotatedSpace<C>, C extends CalibratedAxis> Optional<String> getSpatialUnit(final S space, final UnitService unitService) throws IllegalArgumentException { if (!hasSpatialDimensions(space)) { throw new IllegalArgumentException("Space has no spatial axes."); } if (!isUnitsConvertible(space, unitService)) { return Optional.empty(); } final String unit = space.axis(0).unit(); return unit == null ? Optional.of("") : Optional.of(unit); } }
AxisUtils { public static <S extends AnnotatedSpace<C>, C extends CalibratedAxis> Optional<String> getSpatialUnit(final S space, final UnitService unitService) throws IllegalArgumentException { if (!hasSpatialDimensions(space)) { throw new IllegalArgumentException("Space has no spatial axes."); } if (!isUnitsConvertible(space, unitService)) { return Optional.empty(); } final String unit = space.axis(0).unit(); return unit == null ? Optional.of("") : Optional.of(unit); } private  AxisUtils(); }
AxisUtils { public static <S extends AnnotatedSpace<C>, C extends CalibratedAxis> Optional<String> getSpatialUnit(final S space, final UnitService unitService) throws IllegalArgumentException { if (!hasSpatialDimensions(space)) { throw new IllegalArgumentException("Space has no spatial axes."); } if (!isUnitsConvertible(space, unitService)) { return Optional.empty(); } final String unit = space.axis(0).unit(); return unit == null ? Optional.of("") : Optional.of(unit); } private  AxisUtils(); static long countSpatialDimensions(final S space); static Optional<String> getSpatialUnit(final S space, final UnitService unitService); static boolean hasChannelDimensions(final S space); static boolean hasSpatialDimensions(final S space); static boolean hasTimeDimensions(final S space); static boolean isSpatialCalibrationsIsotropic(final S space, final double tolerance,
			final UnitService unitService); }
AxisUtils { public static <S extends AnnotatedSpace<C>, C extends CalibratedAxis> Optional<String> getSpatialUnit(final S space, final UnitService unitService) throws IllegalArgumentException { if (!hasSpatialDimensions(space)) { throw new IllegalArgumentException("Space has no spatial axes."); } if (!isUnitsConvertible(space, unitService)) { return Optional.empty(); } final String unit = space.axis(0).unit(); return unit == null ? Optional.of("") : Optional.of(unit); } private  AxisUtils(); static long countSpatialDimensions(final S space); static Optional<String> getSpatialUnit(final S space, final UnitService unitService); static boolean hasChannelDimensions(final S space); static boolean hasSpatialDimensions(final S space); static boolean hasTimeDimensions(final S space); static boolean isSpatialCalibrationsIsotropic(final S space, final double tolerance,
			final UnitService unitService);  }