summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/common/io/stream/Writeable.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/java/org/elasticsearch/common/io/stream/Writeable.java')
-rw-r--r--core/src/main/java/org/elasticsearch/common/io/stream/Writeable.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/main/java/org/elasticsearch/common/io/stream/Writeable.java b/core/src/main/java/org/elasticsearch/common/io/stream/Writeable.java
index 75c1f28c39..6ebe1b3b99 100644
--- a/core/src/main/java/org/elasticsearch/common/io/stream/Writeable.java
+++ b/core/src/main/java/org/elasticsearch/common/io/stream/Writeable.java
@@ -46,7 +46,8 @@ public interface Writeable<T> extends StreamableReader<T> { // TODO remove exten
@Override
default T readFrom(StreamInput in) throws IOException {
// See class javadoc for reasoning
- throw new UnsupportedOperationException("Prefer calling a constructor that takes a StreamInput to calling readFrom.");
+ throw new UnsupportedOperationException(
+ "Prefer calling a constructor or static method that takes a StreamInput to calling readFrom.");
}
/**
@@ -56,6 +57,9 @@ public interface Writeable<T> extends StreamableReader<T> { // TODO remove exten
*/
@FunctionalInterface
interface Reader<R> {
- R read(StreamInput t) throws IOException;
+ /**
+ * Read R from a stream.
+ */
+ R read(StreamInput in) throws IOException;
}
}