Remove references to session from PropertyMetadata
`PropertyMetadata` is used to declare e.g. table properties, so not
limited to session properties, as code would previously indicate.
@@ -22,6 +22,7 @@ import static com.facebook.presto.spi.type.BooleanType.BOOLEAN;
import static com.facebook.presto.spi.type.DoubleType.DOUBLE;
import static com.facebook.presto.spi.type.IntegerType.INTEGER;
import static com.facebook.presto.spi.type.VarcharType.VARCHAR;
+import static java.lang.String.format;
import static java.util.Locale.ENGLISH;
import static java.util.Objects.requireNonNull;
@@ -54,10 +55,10 @@ public final class PropertyMetadata<T>
requireNonNull(encoder, "encoder is null");
if (name.isEmpty() || !name.trim().toLowerCase(ENGLISH).equals(name)) {
- throw new IllegalArgumentException(String.format("Invalid session property name '%s'", name));
+ throw new IllegalArgumentException(format("Invalid property name '%s'", name));
}
if (description.isEmpty() || !description.trim().equals(description)) {
- throw new IllegalArgumentException(String.format("Invalid session property description '%s'", description));
+ throw new IllegalArgumentException(format("Invalid property description '%s'", description));
}
this.name = name;
@@ -71,7 +72,7 @@ public final class PropertyMetadata<T>
}
/**
- * Name of the session property. This must be a valid identifier.
+ * Name of the property. This must be a valid identifier.
*/
public String getName()
{
