• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2008, http://www.snakeyaml.org
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 org.yaml.snakeyaml.javabeans;
17 
18 public class Door {
19     private String id;
20     private int height;
21 
Door(String id, int height)22     public Door(String id, int height) {
23         this.id = id;
24         this.height = height;
25     }
26 
Door()27     public Door() {
28         this.height = 3;
29     }
30 
getHeight()31     public int getHeight() {
32         return height;
33     }
34 
setHeight(int height)35     public void setHeight(int height) {
36         this.height = height;
37     }
38 
39     @Override
equals(Object obj)40     public boolean equals(Object obj) {
41         if (obj instanceof Door) {
42             Door door = (Door) obj;
43             return id.equals(door.id);
44         } else {
45             return false;
46         }
47     }
48 
49     @Override
hashCode()50     public int hashCode() {
51         return id.hashCode();
52     }
53 
getId()54     public String getId() {
55         return id;
56     }
57 
setId(String id)58     public void setId(String id) {
59         this.id = id;
60     }
61 
62     @Override
toString()63     public String toString() {
64         return "Door id=" + id;
65     }
66 
67 }
68