ConfigurationDescriptor.java
01 /*
02  * Copyright 2008-2017 the original author or authors.
03  *
04  * Licensed under the Apache License, Version 2.0 (the "License");
05  * you may not use this file except in compliance with the License.
06  * You may obtain a copy of the License at
07  *
08  *     http://www.apache.org/licenses/LICENSE-2.0
09  *
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.codehaus.griffon.runtime.core.configuration;
17 
18 import javax.annotation.Nonnull;
19 
20 import static griffon.util.GriffonNameUtils.requireNonBlank;
21 
22 /**
23  @author Andres Almiray
24  @since 2.11.0
25  */
26 public abstract class ConfigurationDescriptor {
27     private final String configuration;
28     private final String key;
29     private final String defaultValue;
30     private final String format;
31 
32     public ConfigurationDescriptor(@Nonnull String configuration, @Nonnull String key, @Nonnull String defaultValue, @Nonnull String format) {
33         this.configuration = configuration;
34         this.key = requireNonBlank(key, "Argument 'key' must not be blank");
35         this.defaultValue = defaultValue;
36         this.format = format;
37     }
38 
39     @Nonnull
40     public String getConfiguration() {
41         return configuration;
42     }
43 
44     @Nonnull
45     public String getKey() {
46         return key;
47     }
48 
49     @Nonnull
50     public String getDefaultValue() {
51         return defaultValue;
52     }
53 
54     @Nonnull
55     public String getFormat() {
56         return format;
57     }
58 
59     @Nonnull
60     public abstract InjectionPoint asInjectionPoint();
61 }