com.microsoft.signalr.CompletionMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signalr Show documentation
Show all versions of signalr Show documentation
ASP.NET Core SignalR Client for Java applications
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
package com.microsoft.signalr;
import java.util.Map;
public final class CompletionMessage extends HubMessage {
private final int type = HubMessageType.COMPLETION.value;
private Map headers;
private final String invocationId;
private final Object result;
private final String error;
public CompletionMessage(Map headers, String invocationId, Object result, String error) {
if (headers != null && !headers.isEmpty()) {
this.headers = headers;
}
if (error != null && result != null) {
throw new IllegalArgumentException("Expected either 'error' or 'result' to be provided, but not both.");
}
this.invocationId = invocationId;
this.result = result;
this.error = error;
}
public Map getHeaders() {
return headers;
}
public Object getResult() {
return result;
}
public String getError() {
return error;
}
public String getInvocationId() {
return invocationId;
}
@Override
public HubMessageType getMessageType() {
return HubMessageType.values()[type - 1];
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy