class Quantity implements Comparable<Quantity> {

  @NotNull
  public static String addUnit(@NotNull NlProperty property, @NotNull String value) {
    AttributeDefinition definition = property.getDefinition();
    boolean isDimension = definition != null && definition.getFormats().contains(AttributeFormat.DIMENSION);
    if (!isDimension) {
      return value;
    }
    Quantity quantity = parse(value);
    if (quantity == null || !quantity.myUnit.isEmpty()) {
      return value;
    }
    switch (property.getName()) {
      case SdkConstants.ATTR_TEXT_SIZE:
      case SdkConstants.ATTR_LINE_SPACING_EXTRA:
        return quantity.myValue + SdkConstants.UNIT_SP;
      default:
        return quantity.myValue + SdkConstants.UNIT_DP;
    }
  }

  private  Quantity(int value, @NotNull String unit);

}