### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.information.metadata

# Class Comment

java.lang.Object
com.sas.services.information.metadata.Comment

All Implemented Interfaces:
  `CommentInterface`, `Serializable`, `Remote`

@SASScope("ALL") @BinaryCompatibilityOnly public class Comment extends Object implements CommentInterface, Serializable
Represents a comment in a discussion thread

Since:
  1.1
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Comment()`
  Creates a new comment.
  `Comment(UserContextInterface author, String text)`
  Creates a new comment with the author coming from the user context.
  `Comment(UserContextInterface author, String text, boolean secret)`
  Creates a new private comment with the author coming from the user context.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addAttachment(String name, String desc, String mimeType, InputStream content)`
  Add an attachment to the comment.
  `void`
  `delete()`
  Delete the comment - only available to the owner of the comment group
  `String`
  `formatComment(String xsl)`
  Format the content of the comment with the transformation
  `List`
  `getAttachments()`
  Returns the list of attachments for this comment
  `String`
  `getAuthor()`
  Get the comment author
  `String`
  `getText()`
  Get the comment text
  `long`
  `getTimestamp()`
  Get the comment timestamp
  `String`
  `getTimestamp(DateFormat dtFormat)`
  Get the formatted comment timestamp
  `boolean`
  `hasAttachments()`
  Does the comment have an attachment?
  `boolean`
  `isPrivate()`
  Returns whether this comment is private or not
  `void`
  `setAuthor(String author)`
  Sets the author for a comment.
  `void`
  `setText(String text)`
  Sets the text for a comment.
  `void`
  `setTimeStamp(long timestamp)`
  Sets the timestamp for a comment.
  `String`
  `toString()`
  Format a comment for processing as a String.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Comment

    public Comment() throws RemoteException
    Creates a new comment. Reserved for internal use.
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### Comment

    public Comment(UserContextInterface author, String text) throws RemoteException
    Creates a new comment with the author coming from the user context. This is the preferred way of creating comments.
    Parameters:
      `author` - The user context under which the comment is authored
      `text` - The text of the comment
    Throws:
      `RemoteException` - in the event of remote object failure.

  - ### Comment

    public Comment(UserContextInterface author, String text, boolean secret) throws RemoteException
    Creates a new private comment with the author coming from the user context. This is the preferred way of creating comments.
    Parameters:
      `author` - The user context under which the comment is authored
      `text` - The text of the comment
      `secret` - Is this a private comment or not?
    Throws:
      `RemoteException` - in the event of remote object failure.

- ## Method Details

  - ### getText

    public String getText() throws RemoteException
    Description copied from interface: `CommentInterface`
    Get the comment text
    Specified by:
      `getText` in interface `CommentInterface`
    Returns:
      String The comment text
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### getTimestamp

    public String getTimestamp(DateFormat dtFormat) throws RemoteException
    Description copied from interface: `CommentInterface`
    Get the formatted comment timestamp
    Specified by:
      `getTimestamp` in interface `CommentInterface`
    Parameters:
      `dtFormat` - A DateFormat with which to format the comment timestamp
    Returns:
      String The formatted timestamp
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### getTimestamp

    public long getTimestamp() throws RemoteException
    Description copied from interface: `CommentInterface`
    Get the comment timestamp
    Specified by:
      `getTimestamp` in interface `CommentInterface`
    Returns:
      long The timestamp when the comment was initially created
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### getAuthor

    public String getAuthor() throws RemoteException
    Description copied from interface: `CommentInterface`
    Get the comment author
    Specified by:
      `getAuthor` in interface `CommentInterface`
    Returns:
      String The comment author
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### hasAttachments

    public boolean hasAttachments() throws RemoteException
    Description copied from interface: `CommentInterface`
    Does the comment have an attachment?
    Specified by:
      `hasAttachments` in interface `CommentInterface`
    Returns:
      boolean True if there are attachments, false otherwise
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### getAttachments

    public List getAttachments() throws RemoteException
    Description copied from interface: `CommentInterface`
    Returns the list of attachments for this comment
    Specified by:
      `getAttachments` in interface `CommentInterface`
    Returns:
      List(of AttachmentInterface) The list of attachments for this comment
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### addAttachment

    public void addAttachment(String name, String desc, String mimeType, InputStream content) throws RemoteException
    Description copied from interface: `CommentInterface`
    Add an attachment to the comment. Multiple attachments can be made to each comment
    Specified by:
      `addAttachment` in interface `CommentInterface`
    Parameters:
      `name` - A name for this attachment
      `desc` - A description for this attachment
      `mimeType` - A MIME type for this attachment
      `content` - An input stream with the content for this attachment
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### formatComment

    public String formatComment(String xsl) throws RemoteException
    Description copied from interface: `CommentInterface`
    Format the content of the comment with the transformation
    Specified by:
      `formatComment` in interface `CommentInterface`
    Parameters:
      `xsl` - The XSL transformation to use to format the comment.
    Returns:
      The formatted comment string.
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### delete

    public void delete() throws RemoteException
    Description copied from interface: `CommentInterface`
    Delete the comment - only available to the owner of the comment group
    Specified by:
      `delete` in interface `CommentInterface`
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### setTimeStamp

    public void setTimeStamp(long timestamp) throws IllegalStateException, RemoteException
    Description copied from interface: `CommentInterface`
    Sets the timestamp for a comment. This method may only be called if the timestamp is missing. If it has already set then an illegalStateException is thrown. The preferred method of creating a comment is to use the non-default constructor
    Specified by:
      `setTimeStamp` in interface `CommentInterface`
    Parameters:
      `timestamp` - The timestamp for the comment
    Throws:
      `IllegalStateException` - If the timestamp has already been set once.
      `RemoteException` - In the event of remote object failure.

  - ### setAuthor

    public void setAuthor(String author) throws IllegalStateException, RemoteException
    Description copied from interface: `CommentInterface`
    Sets the author for a comment. This method may only be called if the author is missing. If it has already set then an illegalStateException is thrown. The preferred method of creating a comment is to use the non-default constructor
    Specified by:
      `setAuthor` in interface `CommentInterface`
    Parameters:
      `author` - The author for the comment
    Throws:
      `IllegalStateException` - If the author has already been set once.
      `RemoteException` - In the event of remote object failure.

  - ### setText

    public void setText(String text) throws IllegalStateException, RemoteException
    Description copied from interface: `CommentInterface`
    Sets the text for a comment. This method may only be called if the comment text is missing. If it has already set then an illegalStateException is thrown. The preferred method of creating a comment is to use the non-default constructor
    Specified by:
      `setText` in interface `CommentInterface`
    Parameters:
      `text` - The text for the comment
    Throws:
      `IllegalStateException` - If the text is already been set once.
      `RemoteException` - In the event of remote object failure.

  - ### isPrivate

    public boolean isPrivate()
    Description copied from interface: `CommentInterface`
    Returns whether this comment is private or not
    Specified by:
      `isPrivate` in interface `CommentInterface`
    Returns:
      boolean True if comment is private, false otherwise

  - ### toString

    public String toString()
    Format a comment for processing as a String. The format is [timestamp: (Author) Text]
    Overrides:
      `toString` in class `Object`