Skip to content

Commit

Permalink
Rename StreamOutput::getGenericValueWriter to getGenericValueWriterBy…
Browse files Browse the repository at this point in the history
…Class

Signed-off-by: Ketan Verma <ketan9495@gmail.com>
  • Loading branch information
ketanv3 committed Aug 17, 2023
1 parent 81d928a commit 951e813
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ private static Class<?> getGenericType(Object value) {
* Returns the registered writer for the given class type.
*/
@SuppressWarnings("unchecked")
public static <W extends Writer<?>> W getGenericValueWriter(Class<?> type) {
public static <W extends Writer<?>> W getGenericValueWriterByClass(Class<?> type) {
Writer<Object> writer = WriteableRegistry.getWriter(type);
if (writer == null) {
// fallback to this local hashmap
Expand All @@ -833,7 +833,7 @@ public void writeGenericValue(@Nullable Object value) throws IOException {
return;
}
final Class<?> type = getGenericType(value);
final Writer<Object> writer = getGenericValueWriter(type);
final Writer<Object> writer = getGenericValueWriterByClass(type);
writer.write(this, value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ interface InternalValuesSourceCollector {
* Represents an individual term value.
*/
static class TermValue<T> implements Writeable {
private static final Writer<BytesRef> BYTES_REF_WRITER = StreamOutput.getGenericValueWriter(BytesRef.class);
private static final Writer<Long> LONG_WRITER = StreamOutput.getGenericValueWriter(Long.class);
private static final Writer<BigInteger> BIG_INTEGER_WRITER = StreamOutput.getGenericValueWriter(BigInteger.class);
private static final Writer<Double> DOUBLE_WRITER = StreamOutput.getGenericValueWriter(Double.class);
private static final Writer<BytesRef> BYTES_REF_WRITER = StreamOutput.getGenericValueWriterByClass(BytesRef.class);
private static final Writer<Long> LONG_WRITER = StreamOutput.getGenericValueWriterByClass(Long.class);
private static final Writer<BigInteger> BIG_INTEGER_WRITER = StreamOutput.getGenericValueWriterByClass(BigInteger.class);
private static final Writer<Double> DOUBLE_WRITER = StreamOutput.getGenericValueWriterByClass(Double.class);

private final T value;
private final Writer<T> writer;
Expand Down

0 comments on commit 951e813

Please sign in to comment.