/** * Constructs from a name, a plural form of the unit name, and a symbol. * * @param name * The name of the unit. Shall not be <code> * null</code>. * @param plural * The plural form of the name. May be <code> * null</code>, in which * case regular plural- forming rules are used to construct the * plural form from the name. * @param symbol * The symbol for the unit. May be <code>null * </code>. * @throws NameException * <code>name == null</code>. */ protected UnitName(final String name, final String plural, final String symbol) throws NameException { if (name == null) { throw new NameException("Unit name can't be null"); } this.name = name; this.plural = plural == null ? makePlural(name) : plural; this.symbol = symbol; }
/** * Constructs from a name, a plural form of the unit name, and a symbol. * * @param name * The name of the unit. Shall not be <code> * null</code>. * @param plural * The plural form of the name. May be <code> * null</code>, in which * case regular plural- forming rules are used to construct the * plural form from the name. * @param symbol * The symbol for the unit. May be <code>null * </code>. * @throws NameException * <code>name == null</code>. */ protected UnitName(final String name, final String plural, final String symbol) throws NameException { if (name == null) { throw new NameException("Unit name can't be null"); } this.name = name; this.plural = plural == null ? makePlural(name) : plural; this.symbol = symbol; }