leshan icon indicating copy to clipboard operation
leshan copied to clipboard

Refactor ContentFormat Class to make it know which usage is supported.

Open sbernard31 opened this issue 4 years ago • 0 comments

ContentFormat class should be refactor to move the knowledge of what is doable by each format.

The idea is to be able to request on a ContentFormat object if it is able to handle a given usage.

List of usage :

  • single value
  • multi value
  • empty instance
  • unknown instance id
  • timestamped value

So in the code we would be able to check if a ContentFormat is suitable to a usage with something like:

if (!contentFormat.support(Usage.SINGLE_VALUE)) {
   throw new IllegalArgumentException();
}

This should help to add new content format.

sbernard31 avatar Jul 01 '21 12:07 sbernard31