Java API implementation for changes in simulator resource model.
[platform/upstream/iotivity.git] / service / simulator / java / sdk / src / org / oic / simulator / AttributeProperty.java
1 /*
2  * Copyright 2015 Samsung Electronics 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
17 package org.oic.simulator;
18
19 /**
20  * This class represents the resource attribute's value property.
21  */
22 public abstract class AttributeProperty {
23
24     public enum Type {
25         INTEGER, DOUBLE, BOOLEAN, STRING, MODEL, ARRAY
26     }
27
28     private Type mType;
29
30     protected AttributeProperty(Type type) {
31         mType = type;
32     }
33
34     public Type getType() {
35         return mType;
36     }
37
38     public boolean isInteger() {
39         return false;
40     }
41
42     public boolean isDouble() {
43         return false;
44     }
45
46     public boolean isBoolean() {
47         return false;
48     }
49
50     public boolean isString() {
51         return false;
52     }
53
54     public boolean isArray() {
55         return false;
56     }
57
58     public boolean isModel() {
59         return false;
60     }
61
62     public IntegerProperty asInteger() {
63         return null;
64     }
65
66     public DoubleProperty asDouble() {
67         return null;
68     }
69
70     public BooleanProperty asBoolean() {
71         return null;
72     }
73
74     public StringProperty asString() {
75         return null;
76     }
77
78     public ArrayProperty asArray() {
79         return null;
80     }
81
82     public ModelProperty asModel() {
83         return null;
84     }
85
86     public abstract boolean validate(AttributeValue value);
87 }