commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (CODEC-220) Possible more OO-like approach to DigestUtils
Date Wed, 18 May 2016 23:38:12 GMT


Sebb commented on CODEC-220:

Added initial fluent code design.
The names of the methods can obviously be changed at this point - e.g. the done() and asHex()
methods probably need renaming.
I deliberately did not add digest(data) and digestHex(data) methods as there would need to
be one for each data type.

CODEC-220 Fluent interface for DigestUtils


> Possible more OO-like approach to DigestUtils
> ---------------------------------------------
>                 Key: CODEC-220
>                 URL:
>             Project: Commons Codec
>          Issue Type: Improvement
>            Reporter: Sebb
>            Assignee: Sebb
>         Attachments:,
> DigestUtils is starting to get a bit unwieldy with so many similar static methods.
> One approach would be to use a Fluent approach (method chaining).
> e.g. DigestUtils.with("My-Digest").digestHex(File f);
> There would only need to be digest,digestHex and update instance methods for the different
input types, currently byte, ByteBuffer, InputStream, File.
> Whereas at present these are repeated for each digest type.

This message was sent by Atlassian JIRA

View raw message