use of com.unboundid.util.args.TimestampArgument in project ldapsdk by pingidentity.
the class ManageAccountProcessor method getDates.
/**
* Retrieves the value of the "operationValue" argument from the provided
* subcommand's argument parser as an array of {@code Date} objects.
*
* @param subcommand The subcommand to examine.
* @param commandBuffer The buffer to which the manage-account command line
* should be appended.
*
* @return The value of the "operationValue" argument.
*/
@NotNull()
private static Date[] getDates(@NotNull final SubCommand subcommand, @NotNull final StringBuilder commandBuffer) {
final ArgumentParser parser = subcommand.getArgumentParser();
final TimestampArgument arg = parser.getTimestampArgument("operationValue");
final List<Date> dateList = arg.getValues();
final Date[] dateArray = new Date[dateList.size()];
dateList.toArray(dateArray);
if (arg.isPresent()) {
for (final Date d : dateArray) {
commandBuffer.append(' ');
commandBuffer.append(arg.getIdentifierString());
commandBuffer.append(' ');
commandBuffer.append(StaticUtils.encodeGeneralizedTime(d));
}
}
return dateArray;
}
use of com.unboundid.util.args.TimestampArgument in project ldapsdk by pingidentity.
the class ManageAccountProcessor method getDate.
/**
* Retrieves the value of the "operationValue" argument from the provided
* subcommand's argument parser as a {@code Date}.
*
* @param subcommand The subcommand to examine.
* @param commandBuffer The buffer to which the manage-account command line
* should be appended.
*
* @return The value of the "operationValue" argument.
*/
@NotNull()
private static Date getDate(@NotNull final SubCommand subcommand, @NotNull final StringBuilder commandBuffer) {
final ArgumentParser parser = subcommand.getArgumentParser();
final TimestampArgument arg = parser.getTimestampArgument("operationValue");
final Date dateValue = arg.getValue();
if (arg.isPresent()) {
commandBuffer.append(' ');
commandBuffer.append(arg.getIdentifierString());
commandBuffer.append(' ');
commandBuffer.append(StaticUtils.encodeGeneralizedTime(dateValue));
}
return dateValue;
}
Aggregations