public boolean declareProperty(String name, PropertyType<?> type, Object defaultValue) {
    if (name == null) {
      throw new IllegalArgumentException("null name");
    }
    if (type == null) {
      throw new IllegalArgumentException("null type");
    }
    PropertyType<?> ptype = properties.putIfAbsent(name, type);
    if (ptype != null) {
      if (ptype.equals(type)) {
        return false;
      }
      throw new IllegalArgumentException("property " + name + " is already declared");
    }
    Object value = type.cast(defaultValue);
    if (value != null) {
      if (values == null) {
        values = new TreeMap<>();
      }
      values.put(name, value);
    }
    versionNumber.incrementAndGet();
    digest = null;
    return true;
  }
Declares a new property.

@param name         the property name
@param type         the property type
@param defaultValue the default property value
@return true if property is successfully declared, false if it was already declared
@throws IllegalArgumentException if a property with the same name but a different type has already been declared
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/PropertySchema.java