You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "Greg Huber (JIRA)" <ji...@apache.org> on 2014/06/17 17:37:06 UTC

[jira] [Comment Edited] (ROL-1997) Switch WeblogEntry's pub status fields (DRAFT, PUBLISHED, PENDING, SCHEDULED) to an enum type

    [ https://issues.apache.org/jira/browse/ROL-1997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14033930#comment-14033930 ] 

Greg Huber edited comment on ROL-1997 at 6/17/14 3:36 PM:
----------------------------------------------------------

public boolean isPublished() {
        return getStatus().equals(PUBLISHED);
}

If we have an enum here it would make life more difficult.....I find enums are only useful for shuffling around parameter checks and alike, as they have no "real" value?
eg

{code:xml}
public static enum ViewTypes {
  EVENT, MANUFACTURER
}

method parameter >  Enum<ViewTypes> viewType

if (viewType != null && viewType.equals(ViewTypes.EVENT)) {
.. do something
}
{code}


was (Author: gregh99):
public boolean isPublished() {
        return getStatus().equals(PUBLISHED);
}

If we have an enum here it would make life more difficult.....I find enums are only useful for shuffling around parameter checks and alike, as they have no "real" value?
eg

public static enum ViewTypes {
  EVENT, MANUFACTURER
}

method parameter >  Enum<ViewTypes> viewType

if (viewType != null && viewType.equals(ViewTypes.EVENT)) {
.. do something
}

> Switch WeblogEntry's pub status fields (DRAFT, PUBLISHED, PENDING, SCHEDULED) to an enum type
> ---------------------------------------------------------------------------------------------
>
>                 Key: ROL-1997
>                 URL: https://issues.apache.org/jira/browse/ROL-1997
>             Project: Apache Roller
>          Issue Type: Task
>            Reporter: Glen Mazza
>            Assignee: Roller Unassigned
>            Priority: Minor
>
> ...and have that enum type used for the get/setStatus() in WeblogEntrySearchCriteria.



--
This message was sent by Atlassian JIRA
(v6.2#6252)