Coverage Report - org.galagosearch.tupleflow.typebuilder.FieldSpecification
 
Classes in this File Line Coverage Branch Coverage Complexity
FieldSpecification
67%
4/6
N/A
0
FieldSpecification$DataType
67%
18/27
0%
0/2
0
 
 1  
 // BSD License (http://www.galagosearch.org/license)
 2  
 
 3  
 package org.galagosearch.tupleflow.typebuilder;
 4  
 
 5  
 /**
 6  
  *
 7  
  * @author trevor
 8  
  */
 9  
 public class FieldSpecification {
 10  2
     public enum DataType {
 11  2
         BOOLEAN ("boolean", "boolean", "Boolean", false, false, false),
 12  2
         BYTE   ("byte", "byte", "Byte", true, false, false),
 13  2
         SHORT  ("short", "short", "Short", true, false, false),
 14  2
         INT    ("int", "int", "Integer", true, false, false),
 15  2
         LONG   ("long", "long", "Long", true, false, false),
 16  2
         FLOAT  ("float", "float", "Float", false, false, false),
 17  2
         DOUBLE ("double", "double", "Double", false, false, false),
 18  2
         STRING ("String", "String", "String", false, true, false),
 19  2
         BYTES  ("bytes", "byte", "byte[]", false, false, true);
 20  
                 
 21  
         DataType(String internalType, String baseType, String className,
 22  18
                  boolean isInteger, boolean isString, boolean isArray) {
 23  18
             this.internalType = internalType;
 24  18
             this.baseType = baseType;
 25  18
             this.className = className;
 26  18
             this.isInteger = isInteger;
 27  18
             this.isString = isString;
 28  18
             this.isArray = isArray;
 29  18
         }
 30  
 
 31  
         public String getType() {
 32  0
             if (!isArray)
 33  0
                 return baseType;
 34  0
             return baseType + "[]";
 35  
         }
 36  
         
 37  
         public String getBaseType() {
 38  0
             return baseType;
 39  
         }
 40  
         
 41  
         public String getInternalType() {
 42  0
             return internalType;
 43  
         }
 44  
 
 45  
         public boolean isInteger() {
 46  0
             return isInteger;
 47  
         }
 48  
 
 49  
         public boolean isString() {
 50  0
             return isString;
 51  
         }
 52  
         
 53  
         public boolean isArray() {
 54  0
             return isArray;
 55  
         }
 56  
 
 57  
         public String getClassName() {
 58  0
             return className;
 59  
         }
 60  
         
 61  
         private String baseType;
 62  
         private String internalType;
 63  
         private String className;
 64  
         private boolean isInteger;
 65  
         private boolean isString;
 66  
         private boolean isArray;
 67  
     };
 68  
     
 69  8
     public FieldSpecification(DataType type, String name) {
 70  8
         this.type = type;
 71  8
         this.name = name;
 72  8
     }
 73  
     
 74  
     public DataType getType() {
 75  0
         return type;
 76  
     }
 77  
     
 78  
     public String getName() {
 79  0
         return name;
 80  
     }
 81  
     
 82  
     protected DataType type;
 83  
     protected String name;
 84  
 }