class SetOrigin extends Statement {

  @Override
  @Nonnull
  public Result execute(Environment environment) {
    if (!(environment.getOutputRoute() instanceof BgpRoute.Builder<?, ?>)) {
      // Do nothing for non-BGP routes
      return new Result();
    }
    BgpRoute.Builder<?, ?> bgpRoute = (BgpRoute.Builder<?, ?>) environment.getOutputRoute();
    OriginType originType = _origin.evaluate(environment);
    bgpRoute.setOriginType(originType);
    if (environment.getWriteToIntermediateBgpAttributes()) {
      environment.getIntermediateBgpAttributes().setOriginType(originType);
    }
    return new Result();
  }

  public  SetOrigin(OriginExpr origin);

}