Remove some redundant 'throws'; allocate more reasonably sized StringBuffers for...
[zxing.git] / core / src / com / google / zxing / client / result / SMSParsedResult.java
1 /*
2  * Copyright 2008 ZXing authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package com.google.zxing.client.result;
18
19 /**
20  * @author Sean Owen
21  */
22 public final class SMSParsedResult extends ParsedResult {
23
24   private final String smsURI;
25   private final String number;
26   private final String via;
27   private final String subject;
28   private final String body;
29   private final String title;
30
31   public SMSParsedResult(String smsURI, String number, String via, String subject, String body, String title) {
32     super(ParsedResultType.SMS);
33     this.smsURI = smsURI;
34     this.number = number;
35     this.via = via;
36     this.subject = subject;
37     this.body = body;
38     this.title = title;
39   }
40
41   public String getSMSURI() {
42     return smsURI;
43   }
44
45   public String getNumber() {
46     return number;
47   }
48
49   public String getVia() {
50     return via;
51   }
52
53   public String getSubject() {
54     return subject;
55   }
56
57   public String getBody() {
58     return body;
59   }
60
61   public String getTitle() {
62     return title;
63   }
64
65   public String getDisplayResult() {
66     StringBuffer result = new StringBuffer(100);
67     maybeAppend(number, result);
68     maybeAppend(via, result);
69     maybeAppend(subject, result);
70     maybeAppend(body, result);
71     maybeAppend(title, result);
72     return result.toString();
73   }
74
75 }