All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ray.serve.deployment.DeploymentRoute Maven / Gradle / Ivy

There is a newer version: 2.39.0
Show newest version
package io.ray.serve.deployment;

import io.ray.serve.util.ServeProtoUtil;

public class DeploymentRoute {

  private final DeploymentInfo deploymentInfo;

  private final String route;

  public DeploymentRoute(DeploymentInfo deploymentInfo, String route) {
    this.deploymentInfo = deploymentInfo;
    this.route = route;
  }

  public DeploymentInfo getDeploymentInfo() {
    return deploymentInfo;
  }

  public String getRoute() {
    return route;
  }

  public static DeploymentRoute fromProto(io.ray.serve.generated.DeploymentRoute proto) {
    if (proto == null) {
      return null;
    }
    return new DeploymentRoute(
        DeploymentInfo.fromProto(proto.getDeploymentInfo()), proto.getRoute());
  }

  public static DeploymentRoute fromProtoBytes(byte[] bytes) {
    io.ray.serve.generated.DeploymentRoute proto =
        ServeProtoUtil.bytesToProto(bytes, io.ray.serve.generated.DeploymentRoute::parseFrom);
    return fromProto(proto);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy