import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nonnull;
public final class ConnectClientSuccess extends RequestSuccess<ClientIdentifier, ConnectClientSuccess> {
private static final long serialVersionUID = 1L;
+ @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "This field is not Serializable but this class "
+ + "implements writeReplace to delegate serialization to a Proxy class and thus instances of this class "
+ + "aren't serialized. FindBugs does not recognize this.")
private final List<ActorSelection> alternates;
+
+ @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "See justification above.")
private final DataTree dataTree;
private final ActorRef backend;
private final int maxMessages;
this.maxMessages = maxMessages;
}
- public ConnectClientSuccess(final @Nonnull ClientIdentifier target, final long sequence,
- final @Nonnull ActorRef backend, final @Nonnull List<ActorSelection> alternates,
- final @Nonnull DataTree dataTree, final int maxMessages) {
+ public ConnectClientSuccess(@Nonnull final ClientIdentifier target, final long sequence,
+ @Nonnull final ActorRef backend, @Nonnull final List<ActorSelection> alternates,
+ @Nonnull final DataTree dataTree, final int maxMessages) {
this(target, sequence, backend, alternates, Optional.of(dataTree), maxMessages);
}
*
* @return a list of known backend alternates
*/
- public @Nonnull List<ActorSelection> getAlternates() {
+ @Nonnull
+ public List<ActorSelection> getAlternates() {
return alternates;
}
- public @Nonnull ActorRef getBackend() {
+ @Nonnull
+ public ActorRef getBackend() {
return backend;
}
@Override
protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
- return super.addToStringAttributes(toStringHelper).add("alternates", alternates).add("dataTree", dataTree)
- .add("maxMessages", maxMessages);
+ return super.addToStringAttributes(toStringHelper).add("alternates", alternates)
+ .add("dataTree present", getDataTree().isPresent()).add("maxMessages", maxMessages);
}
}