KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > ConfigurationModel


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.config.schema;
5
6 import com.tc.util.Assert;
7
8 /**
9  * Represents the configuration model.
10  */

11 public class ConfigurationModel {
12
13   public static final ConfigurationModel DEVELOPMENT = new ConfigurationModel("development");
14   public static final ConfigurationModel PRODUCTION = new ConfigurationModel("production");
15
16   private final String JavaDoc type;
17
18   private ConfigurationModel(String JavaDoc type) {
19     Assert.assertNotBlank(type);
20     this.type = type;
21   }
22
23   public boolean equals(Object JavaDoc that) {
24     return (that instanceof ConfigurationModel) && ((ConfigurationModel) that).type.equals(this.type);
25   }
26
27   public int hashCode() {
28     return this.type.hashCode();
29   }
30
31   public String JavaDoc toString() {
32     return this.type;
33   }
34
35 }
36
Popular Tags