/*
 * Copyright (c) 2013 Christos KK Loverdos
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ckkloverdos.thrift3r;

/**
 * Binary representation types: these are the types supported at the binary codec level.
 *
 * @author Christos KK Loverdos <loverdos@gmail.com>
 */
public enum BinReprType {
    VOID   ((byte)  0),
    BOOL   ((byte)  1),
    INT8   ((byte)  2),
    INT16  ((byte)  3),
    INT32  ((byte)  4),
    INT64  ((byte)  5),
    FLOAT32((byte)  6),
    FLOAT64((byte)  7),
    STRING ((byte)  10),
    SET    ((byte)  20),
    LIST   ((byte)  21),
    MAP    ((byte)  22),
    OPTION ((byte)  23),
    ENUM   ((byte)  30), // Simple, Java-like enums
    STRUCT ((byte)  40);

    public final byte brType;

    private BinReprType(byte brType) {
        this.brType = brType;
    }

    public boolean hasDirectStringRepresentation() {
        switch(this) {
            case BOOL:
            case INT8:
            case INT16:
            case INT32:
            case INT64:
            case FLOAT32:
            case FLOAT64:
            case STRING:
            case ENUM:
                return true;
            default:
                return false;
        }
    }
}

@@ -864,16 +864,33 @@
 te)  1),
+ // Java: boolean
 %0A    INT
@@ -905,16 +905,30 @@
 te)  2),
+ // Java: byte
 %0A    INT
@@ -943,16 +943,31 @@
 te)  3),
+ // Java: short
 %0A    INT
@@ -982,16 +982,29 @@
 te)  4),
+ // Java: int
 %0A    INT
@@ -1019,16 +1019,30 @@
 te)  5),
+ // Java: long
 %0A    FLO
@@ -1057,16 +1057,31 @@
 te)  6),
+ // Java: float
 %0A    FLO
@@ -1096,16 +1096,32 @@
 te)  7),
+ // Java: double
 %0A    STR
@@ -1213,16 +1213,16 @@
 )  22),%0A
-
     OPTI
@@ -1237,16 +1237,52 @@
 e)  23),
+ // Yes, we support options natively
 %0A    ENU

Add some inline docs in BinReprType