X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fnotification%2Fandroid%2Fnotification-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fiotivity%2Fservice%2Fns%2Fcommon%2FMessage.java;h=fb19713fc19ba8342c12463a3484ea08bfa0b6ae;hb=3c093548382bb2542c87a67e6e5fa32552c29cb3;hp=f2f20579b449f56019e7c6a3d94b49677aca80b5;hpb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/common/Message.java b/service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/common/Message.java index f2f2057..fb19713 100755 --- a/service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/common/Message.java +++ b/service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/common/Message.java @@ -24,153 +24,133 @@ import android.util.Log; import org.iotivity.base.OcRepresentation; /** - * @class Message - * @brief This class provides implementation of Notification Message object. - */ -public class Message -{ + * + * This class provides implementation of Notification Message object. + * + */ +public class Message { + private static final String LOG_TAG = "NotificationService_Message"; - public enum MessageType - { + /** + * This enum is used to represent different types of notification messages + */ + public enum MessageType { ALERT(1), NOTICE(2), EVENT(3), INFO(4), WARNING(5); + private int type; - private MessageType(int type) - { + private MessageType(int type) { this.type = type; } - public int getMessageType() - { + public int getMessageType() { return this.type; } }; - public long mMessageId = 0; - public String mProviderId = null; - public String mSourceName = null; - public MessageType mType = MessageType.ALERT; - public String mTime = null; - public long mTTL = 0; - public String mTitle = null; - public String mContentText = null; - public MediaContents mMediaContents = null; - public String mTopic = null; - public OcRepresentation mExtraInfo = null; + private long mMessageId = 0; + private String mProviderId = null; - private long mNativeHandle = 0; + private String mSourceName = null; + private MessageType mType = MessageType.ALERT; + private String mTime = null; + private long mTTL = 0; + private String mTitle = null; + private String mContentText = null; + private MediaContents mMediaContents = null; + private String mTopic = null; + private OcRepresentation mExtraInfo = null; - public Message(String title, String contentText, String sourceName) - { - Log.i (LOG_TAG, "Message()"); + public Message(String title, String contentText, String sourceName) { + Log.i(LOG_TAG, "Message()"); mTitle = title; mContentText = contentText; mSourceName = sourceName; } - public long getMessageId() - { + public long getMessageId() { return mMessageId; } - public String getProviderId() - { + public String getProviderId() { return mProviderId; } - public String getSourceName () - { + public String getSourceName() { return mSourceName; } - public MessageType getType() - { + public MessageType getType() { return mType; } - public String getTime() - { + public String getTime() { return mTime; } - public long getTTL() - { + public long getTTL() { return mTTL; } - public String getTitle() - { + public String getTitle() { return mTitle; } - public String getContentText() - { + public String getContentText() { return mContentText; } - public MediaContents getMediaContents() - { + public MediaContents getMediaContents() { return mMediaContents; } - public String getTopic() - { + public String getTopic() { return mTopic; } - public OcRepresentation getExtraInfo() - { + public OcRepresentation getExtraInfo() { return mExtraInfo; } - public void setSourceName (String sourceName) - { + public void setSourceName(String sourceName) { mSourceName = sourceName; } - public void setType(MessageType type) - { + public void setType(MessageType type) { mType = type; } - public void setTime(String time) - { + public void setTime(String time) { mTime = time; } - public void setTTL(long ttl) - { + public void setTTL(long ttl) { mTTL = ttl; } - public void setTitle(String title) - { + public void setTitle(String title) { mTitle = title; } - public void setContentText(String contextText) - { + public void setContentText(String contextText) { mContentText = contextText; } - public void setMediaContents(MediaContents mediaContents) - { + public void setMediaContents(MediaContents mediaContents) { mMediaContents = mediaContents; } - public void setTopic(String topic) - { + public void setTopic(String topic) { mTopic = topic; } - public void setExtraInfo(OcRepresentation extraInfo) - { + public void setExtraInfo(OcRepresentation extraInfo) { mExtraInfo = extraInfo; } }