1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
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 com.android.ide.common.layout;
17 
18 import com.android.annotations.NonNull;
19 import com.android.ide.common.api.IAttributeInfo;
20 
21 import java.util.EnumSet;
22 
23 /** Test/mock implementation of {@link IAttributeInfo} */
24 public class TestAttributeInfo implements IAttributeInfo {
25     private final String mName;
26     private final EnumSet<Format> mFormats;
27     private final String mDefinedBy;
28     private final String[] mEnumValues;
29     private final String[] mFlagValues;
30     private final String mJavadoc;
31 
TestAttributeInfo(String name)32     public TestAttributeInfo(String name) {
33         this(name, null, null, null, null, null);
34     }
35 
TestAttributeInfo(String name, EnumSet<Format> formats, String definedBy, String[] enumValues, String[] flagValues, String javadoc)36     public TestAttributeInfo(String name, EnumSet<Format> formats, String definedBy,
37             String[] enumValues, String[] flagValues, String javadoc) {
38         super();
39         this.mName = name;
40         this.mFormats = formats;
41         this.mDefinedBy = definedBy;
42         this.mEnumValues = enumValues;
43         this.mFlagValues = flagValues;
44         this.mJavadoc = javadoc;
45     }
46 
47     @Override
getDeprecatedDoc()48     public String getDeprecatedDoc() {
49         return null;
50     }
51 
52     @Override
getEnumValues()53     public String[] getEnumValues() {
54         return mEnumValues;
55     }
56 
57     @Override
getFlagValues()58     public String[] getFlagValues() {
59         return mFlagValues;
60     }
61 
62     @Override
getFormats()63     public @NonNull EnumSet<Format> getFormats() {
64         return mFormats;
65     }
66 
67     @Override
getJavaDoc()68     public @NonNull String getJavaDoc() {
69         return mJavadoc;
70     }
71 
72     @Override
getName()73     public @NonNull String getName() {
74         return mName;
75     }
76 
77     @Override
getDefinedBy()78     public @NonNull String getDefinedBy() {
79         return mDefinedBy;
80     }
81 }