001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.protobuf; 003 004/** 005 * The WireTypes 006 * 007 * @author Taylor Smock 008 * @since 17862 009 */ 010public enum WireType { 011 /** 012 * int32, int64, uint32, uint64, sing32, sint64, bool, enum 013 */ 014 VARINT(0), 015 /** 016 * fixed64, sfixed64, double 017 */ 018 SIXTY_FOUR_BIT(1), 019 /** 020 * string, bytes, embedded messages, packed repeated fields 021 */ 022 LENGTH_DELIMITED(2), 023 /** 024 * start groups 025 * 026 * @deprecated Unknown reason. Deprecated since at least 2012. 027 */ 028 @Deprecated 029 START_GROUP(3), 030 /** 031 * end groups 032 * 033 * @deprecated Unknown reason. Deprecated since at least 2012. 034 */ 035 @Deprecated 036 END_GROUP(4), 037 /** 038 * fixed32, sfixed32, float 039 */ 040 THIRTY_TWO_BIT(5), 041 042 /** 043 * For unknown WireTypes 044 */ 045 UNKNOWN(Byte.MAX_VALUE); 046 047 private final byte type; 048 049 WireType(int value) { 050 this.type = (byte) value; 051 } 052 053 /** 054 * Get the type representation (byte form) 055 * 056 * @return The wire type byte representation 057 */ 058 public byte getTypeRepresentation() { 059 return this.type; 060 } 061}