tdlib-session-container/src/main/java/it/tdlight/reactiveapi/InstanceSettings.java

42 lines
1.3 KiB
Java
Raw Normal View History

2021-12-05 15:15:28 +01:00
package it.tdlight.reactiveapi;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
2022-03-06 13:27:29 +01:00
import java.util.List;
2022-01-09 18:27:14 +01:00
import java.util.Set;
2021-12-05 15:15:28 +01:00
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class InstanceSettings {
@NotNull
public String id;
/**
2022-09-13 22:15:18 +02:00
* True if this is just a client, false if this is a server
2021-12-05 15:15:28 +01:00
*/
public boolean client;
/**
* If {@link #client} is true, this will be the address of this client
*/
public @Nullable String clientAddress;
2022-01-09 18:27:14 +01:00
/**
* If {@link #client} is false, this will transform resulting events <b>before</b> being sent
*/
2022-03-06 13:27:29 +01:00
public @Nullable List<Class<? extends ResultingEventTransformer>> resultingEventTransformers;
2022-01-09 18:27:14 +01:00
2021-12-05 15:15:28 +01:00
@JsonCreator
public InstanceSettings(@JsonProperty(required = true, value = "id") @NotNull String id,
@JsonProperty(required = true, value = "client") boolean client,
2022-01-09 18:27:14 +01:00
@JsonProperty("clientAddress") @Nullable String clientAddress,
@JsonProperty("resultingEventTransformers") @Nullable
2022-03-06 13:27:29 +01:00
List<Class<? extends ResultingEventTransformer>> resultingEventTransformers) {
2021-12-05 15:15:28 +01:00
this.id = id;
this.client = client;
this.clientAddress = clientAddress;
2022-01-09 18:27:14 +01:00
this.resultingEventTransformers = resultingEventTransformers;
2021-12-05 15:15:28 +01:00
}
}