
io.milvus.param.control.GetReplicasParam Maven / Gradle / Ivy
package io.milvus.param.control;
import io.milvus.exception.ParamException;
import io.milvus.param.ParamUtils;
import lombok.Getter;
import lombok.NonNull;
/**
* Parameters for getReplicas
interface.
*/
@Getter
public class GetReplicasParam {
private final String collectionName;
private boolean withShardNodes;
private GetReplicasParam(@NonNull Builder builder) {
this.collectionName = builder.collectionName;
this.withShardNodes = true;
}
public static Builder newBuilder() {
return new Builder();
}
/**
* Builder for {@link GetReplicasParam} class.
*/
public static final class Builder {
private String collectionName;
private Builder() {
}
/**
* Sets the collection name. Collection name cannot be empty or null.
*
* @param collectionName collection name
* @return Builder
*/
public Builder withCollectionName(@NonNull String collectionName) {
this.collectionName = collectionName;
return this;
}
/**
* Verifies parameters and creates a new {@link GetReplicasParam} instance.
*
* @return {@link GetReplicasParam}
*/
public GetReplicasParam build() throws ParamException {
ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
return new GetReplicasParam(this);
}
}
/**
* Constructs a String
by {@link GetReplicasParam} instance.
*
* @return String
*/
@Override
public String toString() {
return "GetReplicasParam{" +
"collectionName='" + collectionName + '\'' +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy