leshan
leshan copied to clipboard
Refactor ContentFormat Class to make it know which usage is supported.
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.