Note that you need to provide an accessible static factory method in your AutoValue class. * *
* public static TypeAdapter<TransactionResult> typeAdapter(Gson gson) {
* return new AutoValue_TransactionResult.GsonTypeAdapter(gson);
* }
*
+ *
+ * @see
+ * Using TypeAdapterFactory
*/
@GsonTypeAdapterFactory
-public abstract class TransactionResultAdapterFactory implements TypeAdapterFactory {
+public abstract class CommonTypeAdapterFactory implements TypeAdapterFactory {
public static TypeAdapterFactory create() {
- return new AutoValueGson_TransactionResultAdapterFactory();
+ return new AutoValueGson_CommonTypeAdapterFactory();
}
}
diff --git a/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/JsonSerializer.java b/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/JsonSerializer.java
index 6660943002..5ea6c12032 100644
--- a/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/JsonSerializer.java
+++ b/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/JsonSerializer.java
@@ -47,7 +47,7 @@ public static GsonBuilder builder() {
.registerTypeHierarchyAdapter(HashCode.class, new HashCodeJsonSerializer())
.registerTypeAdapter(PublicKey.class, new PublicKeyJsonSerializer())
.registerTypeAdapter(ZonedDateTime.class, new ZonedDateTimeJsonSerializer())
- .registerTypeAdapterFactory(StoredConfigurationAdapterFactory.create())
+ .registerTypeAdapterFactory(CommonTypeAdapterFactory.create())
.setLongSerializationPolicy(LongSerializationPolicy.STRING);
}
diff --git a/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/StoredConfigurationAdapterFactory.java b/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/StoredConfigurationAdapterFactory.java
deleted file mode 100644
index b73c358c7b..0000000000
--- a/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/StoredConfigurationAdapterFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2018 The Exonum Team
- *
- * 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.exonum.binding.common.serialization.json;
-
-import com.google.gson.TypeAdapterFactory;
-import com.ryanharter.auto.value.gson.GsonTypeAdapterFactory;
-
-/**
- * Class used to automatically create Gson type adapters for AutoValue classes.
- * Note that you need to provide static factory method in your AutoValue class.
- *
- *
- * public static TypeAdapter<StoredConfiguration> typeAdapter(Gson gson) {
- * return new AutoValue_StoredConfiguration.GsonTypeAdapter(gson);
- * }
- *
- */
-@GsonTypeAdapterFactory
-public abstract class StoredConfigurationAdapterFactory implements TypeAdapterFactory {
-
- public static TypeAdapterFactory create() {
- return new AutoValueGson_StoredConfigurationAdapterFactory();
- }
-}
diff --git a/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/TransactionLocationAdapterFactory.java b/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/TransactionLocationAdapterFactory.java
deleted file mode 100644
index a7657ef887..0000000000
--- a/exonum-java-binding/common/src/main/java/com/exonum/binding/common/serialization/json/TransactionLocationAdapterFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2018 The Exonum Team
- *
- * 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.exonum.binding.common.serialization.json;
-
-import com.google.gson.TypeAdapterFactory;
-import com.ryanharter.auto.value.gson.GsonTypeAdapterFactory;
-
-/**
- * Class used to automatically create Gson type adapters for AutoValue classes.
- * Note that you need to provide static factory method in your AutoValue class.
- *
- *
- * public static TypeAdapter<TransactionLocation> typeAdapter(Gson gson) {
- * return new AutoValue_TransactionLocation.GsonTypeAdapter(gson);
- * }
- *
- */
-@GsonTypeAdapterFactory
-public abstract class TransactionLocationAdapterFactory implements TypeAdapterFactory {
-
- public static TypeAdapterFactory create() {
- return new AutoValueGson_TransactionLocationAdapterFactory();
- }
-}
diff --git a/exonum-java-binding/core/findbugs-exclude.xml b/exonum-java-binding/core/findbugs-exclude.xml
index c8949890bc..b1fd6a72b6 100644
--- a/exonum-java-binding/core/findbugs-exclude.xml
+++ b/exonum-java-binding/core/findbugs-exclude.xml
@@ -12,6 +12,9 @@
Note that you need to provide an accessible static factory method in your AutoValue class. * *
- * public static TypeAdapter<Block> typeAdapter(Gson gson) {
- * return new AutoValue_Block.GsonTypeAdapter(gson);
+ * public static TypeAdapter<TransactionResult> typeAdapter(Gson gson) {
+ * return new AutoValue_TransactionResult.GsonTypeAdapter(gson);
* }
*
+ *
+ * @see
+ * Using TypeAdapterFactory
*/
@GsonTypeAdapterFactory
-public abstract class BlockAdapterFactory implements TypeAdapterFactory {
+public abstract class CoreTypeAdapterFactory implements TypeAdapterFactory {
public static TypeAdapterFactory create() {
- return new AutoValueGson_BlockAdapterFactory();
+ return new AutoValueGson_CoreTypeAdapterFactory();
}
}
diff --git a/exonum-java-binding/pom.xml b/exonum-java-binding/pom.xml
index 93b5c7ce1d..4eee2dccf7 100644
--- a/exonum-java-binding/pom.xml
+++ b/exonum-java-binding/pom.xml
@@ -122,7 +122,7 @@