1 /*
2 * Copyright 2010 FatWire Corporation. All Rights Reserved.
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 com.fatwire.gst.foundation.properties;
17
18 import com.fatwire.assetapi.data.AssetId;
19
20 /**
21 * Data representing a property value
22 *
23 * @author Tony Field
24 * @since 2011-09-02
25 */
26 public interface Property {
27 /**
28 * The name of the property
29 */
30 String getName();
31
32 /**
33 * The description of the property, for human informational purposes only
34 */
35 String getDescription();
36
37 /**
38 * Returns whether or not the property is set to null. Empty strings are not null.
39 */
40 boolean isNull();
41
42 /**
43 * Returns true if the value is set to TRUE or true. Not set or set to anything else returns false.
44 */
45 boolean asBoolean();
46
47 /**
48 * Returns the property value as a string
49 */
50 String asString();
51
52 /**
53 * Retursn the property as a long.
54 */
55 long asLong();
56
57 /**
58 * Returns the property as an int
59 */
60 int asInt();
61
62 /**
63 * Returns the property as an asset ID.
64 */
65 AssetId asAssetId();
66 }