GUACAMOLE-579: Clean up comments, implement convenience method for tokens without a prefix, and remove unneeded classes.

This commit is contained in:
Virtually Nick
2019-06-20 20:41:41 -04:00
parent 8ab9e51009
commit d8db630dbd
10 changed files with 62 additions and 167 deletions

View File

@@ -65,7 +65,8 @@ public abstract class TokenName {
* automatically be transformed from "CamelCase", "headlessCamelCase",
* "lowercase_with_underscores", and "mixes_ofBoth_Styles" to consistent
* "UPPERCASE_WITH_UNDERSCORES". Each returned attribute will be prefixed
* with "LDAP_".
* with value provided in the prefix. The value provided in prefix will
* be prepended to the attribute name, but will itself not be transformed.
*
* @param name
* The name of the attribute to use to generate the token name.
@@ -99,5 +100,21 @@ public abstract class TokenName {
return builder.toString();
}
/**
* Generate the name of a parameter from the value of the given attribute,
* and with a blank prefix such that the token name will simply be the
* transformed version of the attribute name.
*
* @param name
* The name of the attribute to use to generate the token name.
*
* @return
* The name of the parameter token that should be populated with the
* value of the attribute having the given name.
*/
public static String fromAttribute(final String name) {
return fromAttribute(name, "");
}
}