Bug 60795 - Add enum for msg types
Summary: Add enum for msg types
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSMF (show other bugs)
Version: 3.16-dev
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks: 59836
  Show dependency tree
 
Reported: 2017-03-01 12:05 UTC by Tim Allison
Modified: 2017-03-03 14:35 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Allison 2017-03-01 12:05:02 UTC
Unless there are objections, let's add an enum for the various .msg types: post, note, contact etc.

This is related to TIKA-2281.
Comment 1 Tim Allison 2017-03-01 15:49:06 UTC
r1784978

I accidentally got the naming right.  I think.  Thank you, Javen, for linking this.  I'm not sure I got the preferred deprecation, tho.  Let me know if I should fix that or anything else unsavory about the patch.
Comment 2 Tim Allison 2017-03-01 16:29:34 UTC
From Javen...for posterity:

Add "@deprecated 3.16 beta 3. Use getMessageClassEnum instead...",
@Deprecated, and @Removal(version="3.18")
Comment 3 Javen O'Neal 2017-03-01 17:19:38 UTC
Some comments, without looking at the code:

Will we be able to remove/replace String getMessageClass() with getMessageClassEnum()? The enum version calls the string version (for now). This would mean we'd have to move some code around or rename public String getMessageClass () to private String getMessageClassString().

mainChunks.getMessageClass() looks like this method is part of an interface. Have we deprecated that method in the interface and all implementing classes?
Comment 4 Tim Allison 2017-03-03 14:35:09 UTC
Javen,
  I'm sorry for my delay.

> Will we be able to remove/replace String getMessageClass() with getMessageClassEnum()?

Yes, and then back again much later, right?  The user can still get the underlying StringChunk if they want the literal chunk.

> The enum version calls the string version (for now). This would mean we'd have to move some code around or rename public String getMessageClass () to private String getMessageClassString().

I fixed that.  Thank you.

> mainChunks.getMessageClass() looks like this method is part of an interface. Have we deprecated that method in the interface and all implementing classes?

I don't think we should.  That is a low-level call that returns the StringChunk.  Advanced users should have access to that.