C++: Some code cleanup
[smartapi.git] / Examples / Java / ExtendingModel / src / acme / model / MagneticEntity.java
1 package acme.model;
2
3 import smartapi.common.PROPERTY;
4 import smartapi.model.PhysicalEntity;
5 import smartapi.model.ValueObject;
6
7 public class MagneticEntity extends PhysicalEntity {
8
9         // make sure to add/define custom types and properties in:
10         //   http://talk.smart-api.io/develop/serverworkbench
11         private final String CLASS_TYPE = "http://smart-api.io/ontology/acme#MagneticEntity";
12         private final int PERMEABILITY = PROPERTY.add("http://smart-api.io/ontology/acme#permeability");
13
14         public MagneticEntity()
15         {
16                 super();
17                 this.addType(CLASS_TYPE);
18         }
19
20         public MagneticEntity(String identifierUri)
21         {
22                 super(identifierUri);
23                 this.addType(CLASS_TYPE);
24         }
25
26         // permeability accessors
27         public boolean hasPermeability() { return has(PERMEABILITY); }
28         public ValueObject getPermeability() { return getFirstAs(ValueObject.class, PERMEABILITY); }
29         public void setPermeability(ValueObject p) { set(PERMEABILITY, p); }
30 }