1 /*
2 * Copyright 2006 Simon Raess
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 package net.sf.beep4j.internal.profile;
17
18 import java.util.Arrays;
19
20 import net.sf.beep4j.internal.util.Assert;
21
22 /**
23 * Object representation of a BEEP greeting element.
24 *
25 * @author Simon Raess
26 */
27 public final class Greeting {
28
29 /**
30 * The tokenized localize attribute of the greeting element.
31 */
32 private final String[] localize;
33
34 /**
35 * The tokenized features attribute of the greeting element.
36 */
37 private final String[] features;
38
39 /**
40 * The URIs of all the child profile elements.
41 */
42 private final String[] profiles;
43
44 /**
45 * Creates a new Greeting object representation.
46 *
47 * @param localize the localize tokens
48 * @param features the feature tokens
49 * @param profiles an array of profile URIs
50 */
51 public Greeting(String[] localize, String[] features, String[] profiles) {
52 Assert.notNull("localize", localize);
53 Assert.notNull("features", features);
54 Assert.notNull("profiles", profiles);
55 this.localize = localize;
56 this.features = features;
57 this.profiles = profiles;
58 }
59
60 /**
61 * Gets an array of feature tokens.
62 *
63 * @return feature token array
64 */
65 public String[] getFeatures() {
66 return features;
67 }
68
69 /**
70 * Gets an array of localize tokens.
71 *
72 * @return localize token array
73 */
74 public String[] getLocalize() {
75 return localize;
76 }
77
78 /**
79 * Gets an array of profile URIs.
80 *
81 * @return profile URI array
82 */
83 public String[] getProfiles() {
84 return profiles;
85 }
86
87 @Override
88 public String toString() {
89 return "profiles=" + Arrays.toString(profiles);
90 }
91
92 }