You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by am...@apache.org on 2019/12/30 14:05:11 UTC
[ignite] branch master updated: IGNITE-12511: Fix misleading
javadoc. This closes #7214.
This is an automated email from the ASF dual-hosted git repository.
amashenkov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 8d9ffc5 IGNITE-12511: Fix misleading javadoc. This closes #7214.
8d9ffc5 is described below
commit 8d9ffc5e4a2ceb4e9f6ead3f26ac1c49d3bb96c5
Author: amashenkov <an...@gmail.com>
AuthorDate: Mon Dec 30 17:05:00 2019 +0300
IGNITE-12511: Fix misleading javadoc. This closes #7214.
---
.../src/main/java/org/apache/ignite/IgniteBinary.java | 16 ++++++++++++----
.../java/org/apache/ignite/marshaller/Marshaller.java | 2 ++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
index 3550ff5..53ee19d 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
@@ -26,10 +26,11 @@ import java.util.LinkedList;
import java.util.Map;
import java.util.TreeMap;
import java.util.UUID;
+import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.binary.BinaryObjectBuilder;
import org.apache.ignite.binary.BinaryObjectException;
import org.apache.ignite.binary.BinaryType;
-import org.apache.ignite.binary.BinaryObject;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -308,17 +309,20 @@ import org.jetbrains.annotations.Nullable;
public interface IgniteBinary {
/**
* Gets type ID for given type name.
+ * If no user defined {@link org.apache.ignite.binary.BinaryIdMapper} is configured
+ * via {@link org.apache.ignite.configuration.BinaryConfiguration}, then system mapper will be used.
+ *
*
* @param typeName Type name.
- * @return Type ID.
+ * @return Type ID which a type would have had if it has been registered in Ignite.
*/
- public int typeId(String typeName);
+ public int typeId(@NotNull String typeName);
/**
* Converts provided object to instance of {@link org.apache.ignite.binary.BinaryObject}.
*
* @param obj Object to convert.
- * @return Converted object.
+ * @return Converted object or {@code null} if obj is null.
* @throws org.apache.ignite.binary.BinaryObjectException In case of error.
*/
public <T> T toBinary(@Nullable Object obj) throws BinaryObjectException;
@@ -328,6 +332,7 @@ public interface IgniteBinary {
*
* @param typeName Type name.
* @return Newly binary builder.
+ * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
*/
public BinaryObjectBuilder builder(String typeName) throws BinaryObjectException;
@@ -380,6 +385,7 @@ public interface IgniteBinary {
* @param typeName Type name.
* @param ord Ordinal.
* @return Enum object.
+ * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
*/
public BinaryObject buildEnum(String typeName, int ord) throws BinaryObjectException;
@@ -389,6 +395,7 @@ public interface IgniteBinary {
* @param typeName Type name.
* @param name Name.
* @return Enum object.
+ * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
*/
public BinaryObject buildEnum(String typeName, String name) throws BinaryObjectException;
@@ -398,6 +405,7 @@ public interface IgniteBinary {
* @param typeName Type name.
* @param vals Mapping of enum constant names to ordinals.
* @return Binary type for registered enum.
+ * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
*/
public BinaryType registerEnum(String typeName, Map<String, Integer> vals) throws BinaryObjectException;
}
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/Marshaller.java b/modules/core/src/main/java/org/apache/ignite/marshaller/Marshaller.java
index 7c306a7..080f968 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/Marshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/Marshaller.java
@@ -77,6 +77,7 @@ public interface Marshaller {
/**
* Marshals object to the output stream. This method should not close
* given output stream.
+ * Note: {@code null} obj will be marshaled to binary {@code null} representation.
*
* @param obj Object to marshal.
* @param out Output stream to marshal into.
@@ -86,6 +87,7 @@ public interface Marshaller {
/**
* Marshals object to byte array.
+ * Note: {@code null} obj will be marshaled to binary {@code null} representation.
*
* @param obj Object to marshal.
* @return Byte array.