Skip to content

Javadoc field info v2 #1052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: adv/docs
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/main/java/net/openhft/chronicle/wire/FieldInfo.java
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
import java.util.stream.Collectors;

import static net.openhft.chronicle.wire.WireMarshaller.WIRE_MARSHALLER_CL;
import static net.openhft.chronicle.wire.Wires.*;

/**
* Represents an abstraction for the meta-information of a field within a class or interface.
@@ -53,18 +54,18 @@ static FieldInfo createForField(String name, Class<?> type, BracketType bracketT

/**
* Looks up the meta-information of the fields associated with the provided class and returns
* a pair of information encapsulated in {@link Wires.FieldInfoPair}.
* a pair of information encapsulated in {@link FieldInfoPair}.
*
* @param aClass The class for which field info needs to be retrieved.
* @return A {@link Wires.FieldInfoPair} representing the field information of the class.
* @return A {@link FieldInfoPair} representing the field information of the class.
*/
@NotNull
static Wires.FieldInfoPair lookupClass(@NotNull Class<?> aClass) {
final SerializationStrategy ss = Wires.CLASS_STRATEGY.get(aClass);
static FieldInfoPair lookupClass(@NotNull Class<?> aClass) {
final SerializationStrategy ss = CLASS_STRATEGY.get(aClass);
switch (ss.bracketType()) {
case NONE:
case SEQ:
return Wires.FieldInfoPair.EMPTY;
return FieldInfoPair.EMPTY;
case MAP:
break;
case HISTORY_MESSAGE:
@@ -81,13 +82,13 @@ static Wires.FieldInfoPair lookupClass(@NotNull Class<?> aClass) {
for (@NotNull WireMarshaller.FieldAccess fa : marshaller.fields) {
final String name = fa.field.getName();
final Class<?> type = fa.field.getType();
final SerializationStrategy ss2 = Wires.CLASS_STRATEGY.get(type);
final SerializationStrategy ss2 = CLASS_STRATEGY.get(type);
final BracketType bracketType = ss2.bracketType();
fields.add(createForField(name, type, bracketType, fa.field));
}

// Return a pair of unmodifiable list of fields and a map of field names to their FieldInfo.
return new Wires.FieldInfoPair(
return new FieldInfoPair(
Collections.unmodifiableList(fields),
fields.stream().collect(Collectors.toMap(FieldInfo::name, f -> f)));
}