Skip to content

Commit

Permalink
chore[protocol]: rename boolean to bool
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Jul 11, 2024
1 parent 34f7437 commit a779412
Show file tree
Hide file tree
Showing 31 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public abstract class EnhanceUtils {
}
}

enhanceSerializerMap.put(BooleanSerializer.INSTANCE, new EnhanceBooleanSerializer());
enhanceSerializerMap.put(BoolSerializer.INSTANCE, new EnhanceBoolSerializer());
enhanceSerializerMap.put(ByteSerializer.INSTANCE, new EnhanceByteSerializer());
enhanceSerializerMap.put(ShortSerializer.INSTANCE, new EnhanceShortSerializer());
enhanceSerializerMap.put(IntSerializer.INSTANCE, new EnhanceIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public class ProtocolAnalysis {

static {
// 初始化基础类型序列化器
baseSerializerMap.put(boolean.class, BooleanSerializer.INSTANCE);
baseSerializerMap.put(Boolean.class, BooleanSerializer.INSTANCE);
baseSerializerMap.put(boolean.class, BoolSerializer.INSTANCE);
baseSerializerMap.put(Boolean.class, BoolSerializer.INSTANCE);
baseSerializerMap.put(byte.class, ByteSerializer.INSTANCE);
baseSerializerMap.put(Byte.class, ByteSerializer.INSTANCE);
baseSerializerMap.put(short.class, ShortSerializer.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

cppSerializerMap.put(BooleanSerializer.INSTANCE, new CppBooleanSerializer());
cppSerializerMap.put(BoolSerializer.INSTANCE, new CppBoolSerializer());
cppSerializerMap.put(ByteSerializer.INSTANCE, new CppByteSerializer());
cppSerializerMap.put(ShortSerializer.INSTANCE, new CppShortSerializer());
cppSerializerMap.put(IntSerializer.INSTANCE, new CppIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author godotg
*/
public class CppBooleanSerializer implements ICppSerializer {
public class CppBoolSerializer implements ICppSerializer {

@Override
public Pair<String, String> field(Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

csSerializerMap.put(BooleanSerializer.INSTANCE, new CsBooleanSerializer());
csSerializerMap.put(BoolSerializer.INSTANCE, new CsBoolSerializer());
csSerializerMap.put(ByteSerializer.INSTANCE, new CsByteSerializer());
csSerializerMap.put(ShortSerializer.INSTANCE, new CsShortSerializer());
csSerializerMap.put(IntSerializer.INSTANCE, new CsIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* @author godotg
*/
public class CsBooleanSerializer implements ICsSerializer {
public class CsBoolSerializer implements ICsSerializer {

@Override
public void writeObject(StringBuilder builder, String objectStr, int deep, Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

esSerializerMap.put(BooleanSerializer.INSTANCE, new EsBooleanSerializer());
esSerializerMap.put(BoolSerializer.INSTANCE, new EsBoolSerializer());
esSerializerMap.put(ByteSerializer.INSTANCE, new EsByteSerializer());
esSerializerMap.put(ShortSerializer.INSTANCE, new EsShortSerializer());
esSerializerMap.put(IntSerializer.INSTANCE, new EsIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author godotg
*/
public class EsBooleanSerializer implements IEsSerializer {
public class EsBoolSerializer implements IEsSerializer {
@Override
public Triple<String, String, String> field(Field field, IFieldRegistration fieldRegistration) {
return new Triple<>("boolean", field.getName(), "false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* @author godotg
*/
public class EnhanceBooleanSerializer implements IEnhanceSerializer {
public class EnhanceBoolSerializer implements IEnhanceSerializer {

@Override
public void writeObject(StringBuilder builder, String objectStr, Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

gdSerializerMap.put(BooleanSerializer.INSTANCE, new GdBooleanSerializer());
gdSerializerMap.put(BoolSerializer.INSTANCE, new GdBoolSerializer());
gdSerializerMap.put(ByteSerializer.INSTANCE, new GdByteSerializer());
gdSerializerMap.put(ShortSerializer.INSTANCE, new GdShortSerializer());
gdSerializerMap.put(IntSerializer.INSTANCE, new GdIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author godotg
*/
public class GdBooleanSerializer implements IGdSerializer {
public class GdBoolSerializer implements IGdSerializer {

@Override
public String fieldType(Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

goSerializerMap.put(BooleanSerializer.INSTANCE, new GoBooleanSerializer());
goSerializerMap.put(BoolSerializer.INSTANCE, new GoBoolSerializer());
goSerializerMap.put(ByteSerializer.INSTANCE, new GoByteSerializer());
goSerializerMap.put(ShortSerializer.INSTANCE, new GoShortSerializer());
goSerializerMap.put(IntSerializer.INSTANCE, new GoIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* @author godotg
*/
public class GoBooleanSerializer implements IGoSerializer {
public class GoBoolSerializer implements IGoSerializer {

@Override
public String fieldType(Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

javaSerializerMap.put(BooleanSerializer.INSTANCE, new JavaBooleanSerializer());
javaSerializerMap.put(BoolSerializer.INSTANCE, new JavaBoolSerializer());
javaSerializerMap.put(ByteSerializer.INSTANCE, new JavaByteSerializer());
javaSerializerMap.put(ShortSerializer.INSTANCE, new JavaShortSerializer());
javaSerializerMap.put(IntSerializer.INSTANCE, new JavaIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* @author godotg
*/
public class JavaBooleanSerializer implements IJavaSerializer {
public class JavaBoolSerializer implements IJavaSerializer {

@Override
public void writeObject(StringBuilder builder, String objectStr, int deep, Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

jsSerializerMap.put(BooleanSerializer.INSTANCE, new JsBooleanSerializer());
jsSerializerMap.put(BoolSerializer.INSTANCE, new JsBoolSerializer());
jsSerializerMap.put(ByteSerializer.INSTANCE, new JsByteSerializer());
jsSerializerMap.put(ShortSerializer.INSTANCE, new JsShortSerializer());
jsSerializerMap.put(IntSerializer.INSTANCE, new JsIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author godotg
*/
public class JsBooleanSerializer implements IJsSerializer {
public class JsBoolSerializer implements IJsSerializer {
@Override
public Triple<String, String, String> field(Field field, IFieldRegistration fieldRegistration) {
return new Triple<>("boolean", field.getName(), "false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

ktSerializerMap.put(BooleanSerializer.INSTANCE, new KtBooleanSerializer());
ktSerializerMap.put(BoolSerializer.INSTANCE, new KtBoolSerializer());
ktSerializerMap.put(ByteSerializer.INSTANCE, new KtByteSerializer());
ktSerializerMap.put(ShortSerializer.INSTANCE, new KtShortSerializer());
ktSerializerMap.put(IntSerializer.INSTANCE, new KtIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author godotg
*/
public class KtBooleanSerializer implements IKtSerializer {
public class KtBoolSerializer implements IKtSerializer {

@Override
public Pair<String, String> field(Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

luaSerializerMap.put(BooleanSerializer.INSTANCE, new LuaBooleanSerializer());
luaSerializerMap.put(BoolSerializer.INSTANCE, new LuaBoolSerializer());
luaSerializerMap.put(ByteSerializer.INSTANCE, new LuaByteSerializer());
luaSerializerMap.put(ShortSerializer.INSTANCE, new LuaShortSerializer());
luaSerializerMap.put(IntSerializer.INSTANCE, new LuaIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author godotg
*/
public class LuaBooleanSerializer implements ILuaSerializer {
public class LuaBoolSerializer implements ILuaSerializer {

@Override
public String fieldDefaultValue(Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

phpSerializerMap.put(BooleanSerializer.INSTANCE, new PhpBooleanSerializer());
phpSerializerMap.put(BoolSerializer.INSTANCE, new PhpBoolSerializer());
phpSerializerMap.put(ByteSerializer.INSTANCE, new PhpByteSerializer());
phpSerializerMap.put(ShortSerializer.INSTANCE, new PhpShortSerializer());
phpSerializerMap.put(IntSerializer.INSTANCE, new PhpIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import com.zfoo.protocol.generate.GenerateProtocolFile;
import com.zfoo.protocol.model.Pair;
import com.zfoo.protocol.model.Triple;
import com.zfoo.protocol.registration.field.IFieldRegistration;
import com.zfoo.protocol.util.StringUtils;

Expand All @@ -26,7 +25,7 @@
/**
* @author godotg
*/
public class PhpBooleanSerializer implements IPhpSerializer {
public class PhpBoolSerializer implements IPhpSerializer {

@Override
public Pair<String, String> field(Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

pySerializerMap.put(BooleanSerializer.INSTANCE, new PyBooleanSerializer());
pySerializerMap.put(BoolSerializer.INSTANCE, new PyBoolSerializer());
pySerializerMap.put(ByteSerializer.INSTANCE, new PyByteSerializer());
pySerializerMap.put(ShortSerializer.INSTANCE, new PyShortSerializer());
pySerializerMap.put(IntSerializer.INSTANCE, new PyIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* @author godotg
*/
public class PyBooleanSerializer implements IPySerializer {
public class PyBoolSerializer implements IPySerializer {
@Override
public String fieldDefaultValue(Field field, IFieldRegistration fieldRegistration) {
return "False";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
/**
* @author godotg
*/
public class BooleanSerializer implements ISerializer {
public class BoolSerializer implements ISerializer {

public static final BooleanSerializer INSTANCE = new BooleanSerializer();
public static final BoolSerializer INSTANCE = new BoolSerializer();

@Override
public void writeObject(ByteBuf buffer, Object object, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

scalaSerializerMap.put(BooleanSerializer.INSTANCE, new ScalaBooleanSerializer());
scalaSerializerMap.put(BoolSerializer.INSTANCE, new ScalaBoolSerializer());
scalaSerializerMap.put(ByteSerializer.INSTANCE, new ScalaByteSerializer());
scalaSerializerMap.put(ShortSerializer.INSTANCE, new ScalaShortSerializer());
scalaSerializerMap.put(IntSerializer.INSTANCE, new ScalaIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author godotg
*/
public class ScalaBooleanSerializer implements IScalaSerializer {
public class ScalaBoolSerializer implements IScalaSerializer {

@Override
public Pair<String, String> field(Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void init(GenerateOperation generateOperation) {
protocolOutputPath = FileUtils.joinPath(generateOperation.getProtocolPath(), protocolOutputRootPath);
FileUtils.deleteFile(new File(protocolOutputPath));

tsSerializerMap.put(BooleanSerializer.INSTANCE, new TsBooleanSerializer());
tsSerializerMap.put(BoolSerializer.INSTANCE, new TsBoolSerializer());
tsSerializerMap.put(ByteSerializer.INSTANCE, new TsByteSerializer());
tsSerializerMap.put(ShortSerializer.INSTANCE, new TsShortSerializer());
tsSerializerMap.put(IntSerializer.INSTANCE, new TsIntSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @author godotg
*/
public class TsBooleanSerializer implements ITsSerializer {
public class TsBoolSerializer implements ITsSerializer {

@Override
public Triple<String, String, String> field(Field field, IFieldRegistration fieldRegistration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ public void generateAllProtocols() throws IOException {
generateLanguages.add(CodeLanguage.EcmaScript);
generateLanguages.add(CodeLanguage.TypeScript);
generateLanguages.add(CodeLanguage.Lua);
generateLanguages.add(CodeLanguage.Php);
generateLanguages.add(CodeLanguage.CSharp);
generateLanguages.add(CodeLanguage.GdScript);
generateLanguages.add(CodeLanguage.Python);

// Initialize and then generate the protocol
ProtocolManager.initProtocolAuto(List.of(NormalObject.class, SimpleObject.class, EmptyObject.class), op);
copyFiles();
// copyFiles();
}

@Test
Expand Down

0 comments on commit a779412

Please sign in to comment.