gson serialization extension, from pull request: https://github.com/apache/incubator-dubbo/pull/2699
diff --git a/.gitignore b/.gitignore
index a1c2a23..fe20762 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,7 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
+
+# ignore IDE configuration
+.idea
+*.iml
diff --git a/README.md b/README.md
index b7b9f18..8cab33d 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,3 @@
# dubbo-serialization-gson
-Dubbo gson serialization extension
+
+Dubbo GSON serialization extension
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..715e0c2
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,73 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-gson</artifactId>
+ <version>0.1.0</version>
+ <name>dubbo-serialization-gson</name>
+ <description>GSON serialization implement for dubbo</description>
+
+ <properties>
+ <source.level>1.8</source.level>
+ <target.level>1.8</target.level>
+ <dubbo.version>2.7.0-SNAPSHOT</dubbo.version>
+ <gson.version>2.8.2</gson.version>
+ <junit.version>4.12</junit.version>
+ <hamcrest.version>1.3</hamcrest.version>
+ <mockito.version>2.18.3</mockito.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-bom</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>${gson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <version>${hamcrest.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>${mockito.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${source.level}</source>
+ <target>${target.level}</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectInput.java b/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectInput.java
new file mode 100644
index 0000000..ce2caae
--- /dev/null
+++ b/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectInput.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.dubbo.common.serialize.gson;
+
+import com.google.gson.Gson;
+import org.apache.dubbo.common.serialize.ObjectInput;
+import org.apache.dubbo.common.utils.PojoUtils;
+
+import java.io.BufferedReader;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.lang.reflect.Type;
+
+public class GsonJsonObjectInput implements ObjectInput {
+ private final BufferedReader reader;
+ private Gson gson;
+
+ public GsonJsonObjectInput(InputStream in) {
+ this(new InputStreamReader(in));
+ }
+
+ public GsonJsonObjectInput(Reader reader) {
+ this.reader = new BufferedReader(reader);
+ gson = new Gson();
+ }
+
+ @Override
+ public boolean readBool() throws IOException {
+ return read(boolean.class);
+ }
+
+ @Override
+ public byte readByte() throws IOException {
+ return read(byte.class);
+ }
+
+ @Override
+ public short readShort() throws IOException {
+ return read(short.class);
+ }
+
+ @Override
+ public int readInt() throws IOException {
+ return read(int.class);
+ }
+
+ @Override
+ public long readLong() throws IOException {
+ return read(long.class);
+ }
+
+ @Override
+ public float readFloat() throws IOException {
+ return read(float.class);
+ }
+
+ @Override
+ public double readDouble() throws IOException {
+ return read(double.class);
+ }
+
+ @Override
+ public String readUTF() throws IOException {
+ return read(String.class);
+ }
+
+ @Override
+ public byte[] readBytes() throws IOException {
+ return readLine().getBytes();
+ }
+
+ @Override
+ public Object readObject() throws IOException, ClassNotFoundException {
+ String json = readLine();
+ return gson.fromJson(json, String.class);
+ }
+
+ @Override
+ public <T> T readObject(Class<T> cls) throws IOException, ClassNotFoundException {
+ return read(cls);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public <T> T readObject(Class<T> cls, Type type) throws IOException, ClassNotFoundException {
+ Object value = readObject(cls);
+ return (T) PojoUtils.realize(value, cls, type);
+ }
+
+ private String readLine() throws IOException {
+ String line = reader.readLine();
+ if (line == null || line.trim().length() == 0) throw new EOFException();
+ return line;
+ }
+
+ private <T> T read(Class<T> cls) throws IOException {
+ String json = readLine();
+ return gson.fromJson(json, cls);
+ }
+}
diff --git a/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectOutput.java b/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectOutput.java
new file mode 100644
index 0000000..fffb9e2
--- /dev/null
+++ b/src/main/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectOutput.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.dubbo.common.serialize.gson;
+
+import com.google.gson.Gson;
+import org.apache.dubbo.common.serialize.ObjectOutput;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.Writer;
+
+public class GsonJsonObjectOutput implements ObjectOutput {
+
+ private final PrintWriter writer;
+ private Gson gson = null;
+
+ public GsonJsonObjectOutput(OutputStream out) {
+ this(new OutputStreamWriter(out));
+ }
+
+ public GsonJsonObjectOutput(Writer writer) {
+ this.gson = new Gson();
+ this.writer = new PrintWriter(writer);
+ }
+
+ @Override
+ public void writeBool(boolean v) throws IOException {
+ writeObject(v);
+ }
+
+ @Override
+ public void writeByte(byte v) throws IOException {
+ writeObject(v);
+ }
+
+ @Override
+ public void writeShort(short v) throws IOException {
+ writeObject(v);
+ }
+
+ @Override
+ public void writeInt(int v) throws IOException {
+ writeObject(v);
+ }
+
+ @Override
+ public void writeLong(long v) throws IOException {
+ writeObject(v);
+ }
+
+ @Override
+ public void writeFloat(float v) throws IOException {
+ writeObject(v);
+ }
+
+ @Override
+ public void writeDouble(double v) throws IOException {
+ writeObject(v);
+ }
+
+ @Override
+ public void writeUTF(String v) throws IOException {
+ writeObject(v);
+ }
+
+ @Override
+ public void writeBytes(byte[] b) throws IOException {
+ writer.println(new String(b));
+ }
+
+ @Override
+ public void writeBytes(byte[] b, int off, int len) throws IOException {
+ writer.println(new String(b, off, len));
+ }
+
+ @Override
+ public void writeObject(Object obj) throws IOException {
+ char[] json = gson.toJson(obj).toCharArray();
+ writer.write(json, 0, json.length);
+ writer.println();
+ writer.flush();
+ json = null;
+ }
+
+ @Override
+ public void flushBuffer() throws IOException {
+ writer.flush();
+ }
+
+}
diff --git a/src/main/java/org/apache/dubbo/common/serialize/gson/GsonSerialization.java b/src/main/java/org/apache/dubbo/common/serialize/gson/GsonSerialization.java
new file mode 100644
index 0000000..eaa8f37
--- /dev/null
+++ b/src/main/java/org/apache/dubbo/common/serialize/gson/GsonSerialization.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.dubbo.common.serialize.gson;
+
+import org.apache.dubbo.common.URL;
+import org.apache.dubbo.common.serialize.ObjectInput;
+import org.apache.dubbo.common.serialize.ObjectOutput;
+import org.apache.dubbo.common.serialize.Serialization;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+public class GsonSerialization implements Serialization {
+
+
+ @Override
+ public byte getContentTypeId() {
+ return 16;
+ }
+
+ @Override
+ public String getContentType() {
+ return "text/json";
+ }
+
+ @Override
+ public ObjectOutput serialize(URL url, OutputStream output) throws IOException {
+ return new GsonJsonObjectOutput(output);
+ }
+
+ @Override
+ public ObjectInput deserialize(URL url, InputStream input) throws IOException {
+ return new GsonJsonObjectInput(input);
+ }
+}
diff --git a/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization b/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization
new file mode 100644
index 0000000..f0cd8df
--- /dev/null
+++ b/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization
@@ -0,0 +1 @@
+gson=org.apache.dubbo.common.serialize.gson.GsonSerialization
diff --git a/src/test/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectOutputTest.java b/src/test/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectOutputTest.java
new file mode 100644
index 0000000..8ad69d9
--- /dev/null
+++ b/src/test/java/org/apache/dubbo/common/serialize/gson/GsonJsonObjectOutputTest.java
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.dubbo.common.serialize.gson;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public class GsonJsonObjectOutputTest {
+ private GsonJsonObjectOutput gsonJsonObjectOutput;
+ private GsonJsonObjectInput gsonJsonObjectInput;
+ private ByteArrayOutputStream byteArrayOutputStream;
+ private ByteArrayInputStream byteArrayInputStream;
+
+ @Before
+ public void setUp() throws Exception {
+ this.byteArrayOutputStream = new ByteArrayOutputStream();
+ this.gsonJsonObjectOutput = new GsonJsonObjectOutput(byteArrayOutputStream);
+ }
+
+ @Test
+ public void testWriteBool() throws IOException {
+ this.gsonJsonObjectOutput.writeBool(true);
+ this.flushToInput();
+
+ assertThat(gsonJsonObjectInput.readBool(), is(true));
+ }
+
+ @Test
+ public void testWriteShort() throws IOException {
+ this.gsonJsonObjectOutput.writeShort((short) 2);
+ this.flushToInput();
+
+ assertThat(gsonJsonObjectInput.readShort(), is((short) 2));
+ }
+
+ @Test
+ public void testWriteInt() throws IOException {
+ this.gsonJsonObjectOutput.writeInt(1);
+ this.flushToInput();
+
+ assertThat(gsonJsonObjectInput.readInt(), is(1));
+ }
+
+ @Test
+ public void testWriteLong() throws IOException {
+ this.gsonJsonObjectOutput.writeLong(1000L);
+ this.flushToInput();
+
+ assertThat(gsonJsonObjectInput.readLong(), is(1000L));
+ }
+
+ @Test
+ public void testWriteUTF() throws IOException {
+ this.gsonJsonObjectOutput.writeUTF("Pace Hasîtî 和平 Мир");
+ this.flushToInput();
+
+ assertThat(gsonJsonObjectInput.readUTF(), is("Pace Hasîtî 和平 Мир"));
+ }
+
+
+ @Test
+ public void testWriteFloat() throws IOException {
+ this.gsonJsonObjectOutput.writeFloat(1.88f);
+ this.flushToInput();
+
+ assertThat(this.gsonJsonObjectInput.readFloat(), is(1.88f));
+ }
+
+ @Test
+ public void testWriteDouble() throws IOException {
+ this.gsonJsonObjectOutput.writeDouble(1.66d);
+ this.flushToInput();
+
+ assertThat(this.gsonJsonObjectInput.readDouble(), is(1.66d));
+ }
+
+ @Test
+ public void testWriteBytes() throws IOException {
+ this.gsonJsonObjectOutput.writeBytes("hello".getBytes());
+ this.flushToInput();
+
+ assertThat(this.gsonJsonObjectInput.readBytes(), is("hello".getBytes()));
+ }
+
+ @Test
+ public void testWriteBytesWithSubLength() throws IOException {
+ this.gsonJsonObjectOutput.writeBytes("hello".getBytes(), 2, 2);
+ this.flushToInput();
+
+ assertThat(this.gsonJsonObjectInput.readBytes(), is("ll".getBytes()));
+ }
+
+ @Test
+ public void testWriteByte() throws IOException {
+ this.gsonJsonObjectOutput.writeByte((byte) 123);
+ this.flushToInput();
+
+ assertThat(this.gsonJsonObjectInput.readByte(), is((byte) 123));
+ }
+
+ @Test
+ public void testWriteObject() throws IOException, ClassNotFoundException {
+ Image image = new Image("http://dubbo.io/logo.png", "logo", 300, 480, Image.Size.SMALL);
+ this.gsonJsonObjectOutput.writeObject(image);
+ this.flushToInput();
+
+ Image readObjectForImage = gsonJsonObjectInput.readObject(Image.class);
+ assertThat(readObjectForImage, not(nullValue()));
+ assertThat(readObjectForImage, is(image));
+ }
+
+ private void flushToInput() throws IOException {
+ this.gsonJsonObjectOutput.flushBuffer();
+ this.byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
+ this.gsonJsonObjectInput = new GsonJsonObjectInput(byteArrayInputStream);
+ }
+}
diff --git a/src/test/java/org/apache/dubbo/common/serialize/gson/GsonJsonSerializationTest.java b/src/test/java/org/apache/dubbo/common/serialize/gson/GsonJsonSerializationTest.java
new file mode 100644
index 0000000..a541b1e
--- /dev/null
+++ b/src/test/java/org/apache/dubbo/common/serialize/gson/GsonJsonSerializationTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.dubbo.common.serialize.gson;
+
+import org.apache.dubbo.common.serialize.ObjectInput;
+import org.apache.dubbo.common.serialize.ObjectOutput;
+import org.hamcrest.Matchers;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+
+public class GsonJsonSerializationTest {
+ private GsonSerialization gsonJsonSerialization;
+
+ @Before
+ public void setUp() {
+ this.gsonJsonSerialization = new GsonSerialization();
+ }
+
+ @Test
+ public void testContentType() {
+ assertThat(gsonJsonSerialization.getContentType(), is("text/json"));
+ }
+
+ @Test
+ public void testContentTypeId() {
+ assertThat(gsonJsonSerialization.getContentTypeId(), is((byte) 16));
+ }
+
+ @Test
+ public void testObjectOutput() throws IOException {
+ ObjectOutput objectOutput = gsonJsonSerialization.serialize(null, mock(OutputStream.class));
+ assertThat(objectOutput, Matchers.<ObjectOutput>instanceOf(GsonJsonObjectOutput.class));
+ }
+
+ @Test
+ public void testObjectInput() throws IOException {
+ ObjectInput objectInput = gsonJsonSerialization.deserialize(null, mock(InputStream.class));
+ assertThat(objectInput, Matchers.<ObjectInput>instanceOf(GsonJsonObjectInput.class));
+ }
+}
diff --git a/src/test/java/org/apache/dubbo/common/serialize/gson/Image.java b/src/test/java/org/apache/dubbo/common/serialize/gson/Image.java
new file mode 100644
index 0000000..d1316d3
--- /dev/null
+++ b/src/test/java/org/apache/dubbo/common/serialize/gson/Image.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.dubbo.common.serialize.gson;
+
+
+public class Image implements java.io.Serializable {
+ private static final long serialVersionUID = 1L;
+ public String uri;
+ public String title; // Can be null
+ public int width;
+ public int height;
+ public Size size;
+
+ public Image() {
+ }
+
+ public Image(String uri, String title, int width, int height, Size size) {
+ this.height = height;
+ this.title = title;
+ this.uri = uri;
+ this.width = width;
+ this.size = size;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Image image = (Image) o;
+
+ if (height != image.height) return false;
+ if (width != image.width) return false;
+ if (size != image.size) return false;
+ if (title != null ? !title.equals(image.title) : image.title != null) return false;
+ if (uri != null ? !uri.equals(image.uri) : image.uri != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = uri != null ? uri.hashCode() : 0;
+ result = 31 * result + (title != null ? title.hashCode() : 0);
+ result = 31 * result + width;
+ result = 31 * result + height;
+ result = 31 * result + (size != null ? size.hashCode() : 0);
+ return result;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("[Image ");
+ sb.append("uri=").append(uri);
+ sb.append(", title=").append(title);
+ sb.append(", width=").append(width);
+ sb.append(", height=").append(height);
+ sb.append(", size=").append(size);
+ sb.append("]");
+ return sb.toString();
+ }
+
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ public Size getSize() {
+ return size;
+ }
+
+ public void setSize(Size size) {
+ this.size = size;
+ }
+
+ public enum Size {
+ SMALL, LARGE
+ }
+}
diff --git a/target/classes/META-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization b/target/classes/META-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization
new file mode 100644
index 0000000..f0cd8df
--- /dev/null
+++ b/target/classes/META-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization
@@ -0,0 +1 @@
+gson=org.apache.dubbo.common.serialize.gson.GsonSerialization