1 4 package com.tctest.spring.bean; 5 6 public class PersistentSubobject { 7 8 public static final String NOT_SENT = "NotSent"; 9 10 public static final String QUEUED = "Queued"; 11 12 private static final String PENDING = "Pending"; 13 14 public static final String SENT = "Sent"; 15 16 public static final String FAILED = "Failed"; 17 18 public static final String DELIVERED = "Delivered"; 19 20 private int messageId; 21 22 private String statusCode; 23 24 private String smscMessageId; 25 26 PersistentSubobject() { 27 } 28 29 public PersistentSubobject(String code) { 30 statusCode = code; 31 } 32 33 public PersistentSubobject(int messageId, String statusCode, String smscMessageId) { 34 this.messageId = messageId; 35 this.statusCode = statusCode; 36 this.smscMessageId = smscMessageId; 37 } 38 39 public int getMessageId() { 40 return messageId; 41 } 42 43 public void noteQueued() { 44 this.statusCode = QUEUED; 45 } 46 47 public boolean isSentOrDelivered() { 48 return statusCode.equals(SENT) || statusCode.equals(DELIVERED); 49 } 50 51 public String getSMSCMessageId() { 52 return smscMessageId; 53 } 54 55 public String getStatusCode() { 56 return statusCode; 57 } 58 59 } 60 | Popular Tags |