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 java.io.Serializable;
19
20 import com.fatwire.assetapi.data.AssetId;
21 import com.fatwire.gst.foundation.facade.assetapi.AssetIdUtils;
22
23
24
25
26
27
28
29 final class PropertyImpl implements Property, Serializable {
30
31
32
33 private static final long serialVersionUID = 692797066527955686L;
34 String name;
35 String description;
36 String value;
37 PropertyImpl(String name, String description, String value) {
38 this.name = name;
39 this.value = value;
40 }
41 public String getName() {
42 return name;
43 }
44 public String getDescription() {
45 return description;
46 }
47 public boolean isNull() {
48 return value == null;
49 }
50 public boolean asBoolean() {
51 return Boolean.getBoolean(value);
52 }
53 public String asString() {
54 return value;
55 }
56 public long asLong() {
57 return Long.valueOf(value);
58 }
59 public int asInt() {
60 return Integer.valueOf(value);
61 }
62 public AssetId asAssetId() {
63 return AssetIdUtils.fromString(value);
64 }
65
66 public String toString() {
67 return "GSTProperty:"+name+"="+value;
68 }
69 }