/** * @return * * @throws NotAvailableException * @deprecated please use {@code getUnitType()} instead. */ @Deprecated default UnitType getType() throws NotAvailableException { return getUnitType(); }
/** * This method returns the unit class resolved by the given unit. * * @param unit the unit to extract the unit class. * @return the unit data class. * @throws org.openbase.jul.exception.NotAvailableException is thrown if the data class could not be detected. */ public static Class<? extends GeneratedMessage> getUnitDataClass(final Unit<?> unit) throws NotAvailableException { return UnitConfigProcessor.getUnitDataClass(unit.getUnitType()); } }
/** * Returns true if this unit is a base unit. * * @return is true if this unit is a base unit. * * @throws CouldNotPerformException is throw if the check could not be performed. */ default boolean isBaseUnit() throws CouldNotPerformException { return UnitConfigProcessor.isDalUnit(getUnitType()); }
/** * Returns true if this unit is a dal unit. * * @return is true if this unit is a dal unit. * * @throws CouldNotPerformException is throw if the check could not be performed. */ default boolean isDalUnit() throws CouldNotPerformException { return UnitConfigProcessor.isDalUnit(getUnitType()); }
public static void verifyUnitType(final Unit<?> unit) throws VerificationFailedException { try { UnitConfigProcessor.verifyUnitType(unit.getConfig(), unit.getUnitType()); } catch (NotAvailableException ex) { throw new VerificationFailedException("Could not verify unit type!", ex); } }
public static void verifyUnitConfig(final Unit<?> unit) throws VerificationFailedException { try { UnitConfigProcessor.verifyUnitConfig(unit.getConfig(), unit.getUnitType()); } catch (NotAvailableException ex) { throw new VerificationFailedException("Could not verify unit type!", ex); } }