1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.fatwire.gst.foundation.properties;
17
18 import com.fatwire.assetapi.data.AssetId;
19 import com.fatwire.gst.foundation.facade.assetapi.AssetIdUtils;
20
21
22
23
24
25
26
27 final class PropertyImpl implements Property {
28 String name;
29 String description;
30 String value;
31 PropertyImpl(String name, String description, String value) {
32 this.name = name;
33 this.value = value;
34 }
35 public String getName() {
36 return name;
37 }
38 public String getDescription() {
39 return description;
40 }
41 public boolean isNull() {
42 return value == null;
43 }
44 public boolean asBoolean() {
45 return Boolean.getBoolean(value);
46 }
47 public String asString() {
48 return value;
49 }
50 public long asLong() {
51 return Long.valueOf(value);
52 }
53 public int asInt() {
54 return Integer.valueOf(value);
55 }
56 public AssetId asAssetId() {
57 return AssetIdUtils.fromString(value);
58 }
59
60 public String toString() {
61 return "GSTProperty:"+name+"="+value;
62 }
63 }