text:
using System.Collections.Generic;
using System.Web.Mvc;

namespace XCLCMS.View.AdminWeb.Controllers.Merchant
{
    /// <summary>
    /// 商户信息controller
    /// </summary>
    public class MerchantController : BaseController
    {
        /// <summary>
        /// 商户信息列表首页
        /// </summary>
        [XCLCMS.Lib.Filters.FunctionFilter(Function = XCLCMS.Data.CommonHelper.Function.FunctionEnum.SysFun_UserAdmin_MerchantView)]
        public ActionResult Index()
        {
            XCLCMS.View.AdminWeb.Models.Merchant.MerchantListVM viewModel = new XCLCMS.View.AdminWeb.Models.Merchant.MerchantListVM();

            #region 初始化查询条件

            viewModel.Search = new XCLNetSearch.Search();
            viewModel.Search.TypeList = new List<XCLNetSearch.SearchFieldInfo>() {
                new XCLNetSearch.SearchFieldInfo("商户ID","MerchantID|number|text",""),
                new XCLNetSearch.SearchFieldInfo("商户名","MerchantName|string|text",""),
                new XCLNetSearch.SearchFieldInfo("商户类型","FK_MerchantType|number|select",XCLCMS.Lib.Common.Comm.GetSysDicOptionsByCode("MerchantType")),
                new XCLNetSearch.SearchFieldInfo("商户系统类型","MerchantSystemType|string|select",XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.MerchantSystemTypeEnum))),
                new XCLNetSearch.SearchFieldInfo("绑定的域名","Domain|string|text",""),
                new XCLNetSearch.SearchFieldInfo("联系人","ContactName|string|text",""),
                new XCLNetSearch.SearchFieldInfo("手机","Tel|string|text",""),
                new XCLNetSearch.SearchFieldInfo("固话","Landline|string|text",""),
                new XCLNetSearch.SearchFieldInfo("电子邮件","Email|string|text",""),
                new XCLNetSearch.SearchFieldInfo("QQ","QQ|string|text",""),
                new XCLNetSearch.SearchFieldInfo("证件类型","FK_PassType|number|select",XCLCMS.Lib.Common.Comm.GetSysDicOptionsByCode("PassType")),
                new XCLNetSearch.SearchFieldInfo("证件号","PassNumber|string|text",""),
                new XCLNetSearch.SearchFieldInfo("地址","Address|string|text",""),
                new XCLNetSearch.SearchFieldInfo("其它联系信息","OtherContact|string|text",""),
                new XCLNetSearch.SearchFieldInfo("商户备注","MerchantRemark|string|text",""),
                new XCLNetSearch.SearchFieldInfo("注册时间","RegisterTime|dateTime|text",""),
                new XCLNetSearch.SearchFieldInfo("商户状态","MerchantState|string|select",XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.MerchantStateEnum))),

                new XCLNetSearch.SearchFieldInfo("备注","Remark|string|text",""),
                new XCLNetSearch.SearchFieldInfo("记录状态","RecordState|string|select",XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.RecordStateEnum))),
                new XCLNetSearch.SearchFieldInfo("创建时间","CreateTime|dateTime|text",""),
                new XCLNetSearch.SearchFieldInfo("创建者名","CreaterName|string|text",""),
                new XCLNetSearch.SearchFieldInfo("更新时间","UpdateTime|dateTime|text",""),
                new XCLNetSearch.SearchFieldInfo("更新人名","UpdaterName|string|text","")
            };
            string strWhere = viewModel.Search.StrSQL;

            if (!XCLCMS.Lib.Permission.PerHelper.HasPermission(base.UserID, Data.CommonHelper.Function.FunctionEnum.SysFun_DataFilter_ShowAllRecordState))
            {
                strWhere = XCLNetTools.DataBase.SQLLibrary.JoinWithAnd(new List<string>() {
                    strWhere,
                    "RecordState='N'"
                });
            }

            #endregion 初始化查询条件

            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<XCLCMS.Data.WebAPIEntity.RequestEntity.PageListConditionEntity>(base.UserToken);
            request.Body = new Data.WebAPIEntity.RequestEntity.PageListConditionEntity()
            {
                PagerInfoSimple = base.PageParamsInfo.ToPagerInfoSimple(),
                Where = strWhere
            };
            var response = XCLCMS.Lib.WebAPI.MerchantAPI.PageList(request).Body;
            viewModel.MerchantList = response.ResultList;
            viewModel.PagerModel = response.PagerInfo;

            return View("~/Views/Merchant/MerchantList.cshtml", viewModel);
        }

        /// <summary>
        /// 添加与编辑商户页面首页
        /// </summary>
        [XCLCMS.Lib.Filters.FunctionFilter(Function = XCLCMS.Data.CommonHelper.Function.FunctionEnum.SysFun_UserAdmin_MerchantAdd)]
        [XCLCMS.Lib.Filters.FunctionFilter(Function = XCLCMS.Data.CommonHelper.Function.FunctionEnum.SysFun_UserAdmin_MerchantEdit)]
        public ActionResult Add()
        {
            long merchantId = XCLNetTools.StringHander.FormHelper.GetLong("merchantId");

            XCLCMS.View.AdminWeb.Models.Merchant.MerchantAddVM viewModel = new XCLCMS.View.AdminWeb.Models.Merchant.MerchantAddVM();
            viewModel.Merchant = new XCLCMS.Data.Model.View.v_Merchant();

            var merchantTypeDic = XCLCMS.Lib.Common.FastAPI.MerchantAPI_GetMerchantTypeDic(base.UserToken);
            var passTypeDic = XCLCMS.Lib.Common.FastAPI.SysDicAPI_GetPassTypeDic(base.UserToken);

            switch (base.CurrentHandleType)
            {
                case XCLNetTools.Enum.CommonEnum.HandleTypeEnum.ADD:
                    viewModel.Merchant = new Data.Model.View.v_Merchant();
                    viewModel.Merchant.RecordState = XCLCMS.Data.CommonHelper.EnumType.RecordStateEnum.N.ToString();
                    viewModel.MerchantTypeOptions = XCLNetTools.Control.HtmlControl.Lib.GetOptions(merchantTypeDic, new XCLNetTools.Entity.SetOptionEntity()
                    {
                        IsNeedPleaseSelect = true
                    });
                    viewModel.PassTypeOptions = XCLNetTools.Control.HtmlControl.Lib.GetOptions(passTypeDic, new XCLNetTools.Entity.SetOptionEntity()
                    {
                        IsNeedPleaseSelect = true
                    });
                    viewModel.MerchantSystemTypeOptions = XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.MerchantSystemTypeEnum), new XCLNetTools.Entity.SetOptionEntity()
                    {
                        IsNeedPleaseSelect = false
                    });
                    viewModel.MerchantStateOptions = XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.MerchantStateEnum));
                    viewModel.FormAction = Url.Action("AddSubmit", "Merchant");
                    break;

                case XCLNetTools.Enum.CommonEnum.HandleTypeEnum.UPDATE:

                    var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<long>(base.UserToken);
                    request.Body = merchantId;
                    var response = XCLCMS.Lib.WebAPI.MerchantAPI.Detail(request);

                    viewModel.Merchant = response.Body;
                    viewModel.MerchantTypeOptions = XCLNetTools.Control.HtmlControl.Lib.GetOptions(merchantTypeDic, new XCLNetTools.Entity.SetOptionEntity()
                    {
                        DefaultValue = viewModel.Merchant.FK_MerchantType.ToString(),
                        IsNeedPleaseSelect = true
                    });
                    viewModel.PassTypeOptions = XCLNetTools.Control.HtmlControl.Lib.GetOptions(passTypeDic, new XCLNetTools.Entity.SetOptionEntity()
                    {
                        DefaultValue = viewModel.Merchant.FK_PassType.ToString(),
                        IsNeedPleaseSelect = true
                    });
                    viewModel.MerchantSystemTypeOptions = XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.MerchantSystemTypeEnum), new XCLNetTools.Entity.SetOptionEntity()
                    {
                        DefaultValue = viewModel.Merchant.MerchantSystemType,
                        IsNeedPleaseSelect = false
                    });
                    viewModel.MerchantStateOptions = XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.MerchantStateEnum), new XCLNetTools.Entity.SetOptionEntity()
                    {
                        DefaultValue = viewModel.Merchant.MerchantState
                    });
                    viewModel.FormAction = Url.Action("UpdateSubmit", "Merchant");
                    break;
            }

            viewModel.RecordStateOptions = XCLNetTools.Control.HtmlControl.Lib.GetOptions(typeof(XCLCMS.Data.CommonHelper.EnumType.RecordStateEnum), new XCLNetTools.Entity.SetOptionEntity()
            {
                IsNeedPleaseSelect = false,
                DefaultValue = viewModel.Merchant.RecordState
            });

            return View("~/Views/Merchant/MerchantAdd.cshtml", viewModel);
        }

        /// <summary>
        /// 查看页
        /// </summary>
        [XCLCMS.Lib.Filters.FunctionFilter(Function = XCLCMS.Data.CommonHelper.Function.FunctionEnum.SysFun_UserAdmin_MerchantView)]
        public ActionResult Show()
        {
            var viewModel = new XCLCMS.View.AdminWeb.Models.Merchant.MerchantShowVM();
            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<long>(base.UserToken);
            request.Body = XCLNetTools.StringHander.FormHelper.GetLong("MerchantID");
            var response = XCLCMS.Lib.WebAPI.MerchantAPI.Detail(request);
            viewModel.Merchant = response.Body ?? new Data.Model.View.v_Merchant();
            return View("~/Views/Merchant/MerchantShow.cshtml", viewModel);
        }

        /// <summary>
        /// 将表单值转为viewModel
        /// </summary>
        private XCLCMS.View.AdminWeb.Models.Merchant.MerchantAddVM GetViewModel(FormCollection fm)
        {
            XCLCMS.View.AdminWeb.Models.Merchant.MerchantAddVM viewModel = new XCLCMS.View.AdminWeb.Models.Merchant.MerchantAddVM();
            viewModel.Merchant = new Data.Model.View.v_Merchant();
            viewModel.Merchant.Address = (fm["txtAddress"] ?? "").Trim();
            viewModel.Merchant.ContactName = (fm["txtContactName"] ?? "").Trim();
            viewModel.Merchant.Domain = (fm["txtDomain"] ?? "").Trim();
            viewModel.Merchant.Email = (fm["txtEmail"] ?? "").Trim();
            viewModel.Merchant.Landline = (fm["txtLandline"] ?? "").Trim();
            viewModel.Merchant.LogoURL = (fm["txtLogoURL"] ?? "").Trim();
            viewModel.Merchant.MerchantName = (fm["txtMerchantName"] ?? "").Trim();
            viewModel.Merchant.MerchantRemark = (fm["txtMerchantRemark"] ?? "").Trim();
            viewModel.Merchant.MerchantState = (fm["selMerchantState"] ?? "").Trim();
            viewModel.Merchant.FK_MerchantType = XCLNetTools.StringHander.FormHelper.GetLong("selMerchantType");
            viewModel.Merchant.OtherContact = (fm["txtOtherContact"] ?? "").Trim();
            viewModel.Merchant.PassNumber = (fm["txtPassNumber"] ?? "").Trim();
            viewModel.Merchant.FK_PassType = XCLNetTools.StringHander.FormHelper.GetLong("selPassType");
            viewModel.Merchant.QQ = (fm["txtQQ"] ?? "").Trim();
            viewModel.Merchant.RegisterTime = XCLNetTools.Common.DataTypeConvert.ToDateTimeNull((fm["txtRegisterTime"] ?? "").Trim());
            viewModel.Merchant.Remark = (fm["txtRemark"] ?? "").Trim();
            viewModel.Merchant.Tel = (fm["txtTel"] ?? "").Trim();
            viewModel.Merchant.MerchantSystemType = fm["selMerchantSystemType"];
            viewModel.Merchant.RecordState = fm["selRecordState"];
            return viewModel;
        }

        /// <summary>
        /// 添加商户信息
        /// </summary>
        [HttpPost]
        [XCLCMS.Lib.Filters.FunctionFilter(Function = XCLCMS.Data.CommonHelper.Function.FunctionEnum.SysFun_UserAdmin_MerchantAdd)]
        public override ActionResult AddSubmit(FormCollection fm)
        {
            XCLCMS.View.AdminWeb.Models.Merchant.MerchantAddVM viewModel = this.GetViewModel(fm);
            XCLCMS.Data.Model.Merchant model = new XCLCMS.Data.Model.Merchant();
            model.MerchantID = XCLCMS.Lib.Common.FastAPI.CommonAPI_GenerateID(base.UserToken, new Data.WebAPIEntity.RequestEntity.Common.GenerateIDEntity()
            {
                IDType = Data.CommonHelper.EnumType.IDTypeEnum.MER.ToString()
            });
            model.Address = viewModel.Merchant.Address;
            model.ContactName = viewModel.Merchant.ContactName;
            model.Domain = viewModel.Merchant.Domain;
            model.Email = viewModel.Merchant.Email;
            model.Landline = viewModel.Merchant.Landline;
            model.LogoURL = viewModel.Merchant.LogoURL;
            model.MerchantName = viewModel.Merchant.MerchantName;
            model.MerchantRemark = viewModel.Merchant.MerchantRemark;
            model.MerchantState = viewModel.Merchant.MerchantState;
            model.FK_MerchantType = viewModel.Merchant.FK_MerchantType;
            model.OtherContact = viewModel.Merchant.OtherContact;
            model.PassNumber = viewModel.Merchant.PassNumber;
            model.FK_PassType = viewModel.Merchant.FK_PassType;
            model.QQ = viewModel.Merchant.QQ;
            model.RecordState = viewModel.Merchant.RecordState;
            model.RegisterTime = viewModel.Merchant.RegisterTime;
            model.Remark = viewModel.Merchant.Remark;
            model.Tel = viewModel.Merchant.Tel;
            model.MerchantSystemType = viewModel.Merchant.MerchantSystemType;

            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<XCLCMS.Data.Model.Merchant>(base.UserToken);
            request.Body = model;
            var response = XCLCMS.Lib.WebAPI.MerchantAPI.Add(request);

            return Json(response);
        }

        /// <summary>
        /// 更新商户信息
        /// </summary>
        [HttpPost]
        [XCLCMS.Lib.Filters.FunctionFilter(Function = XCLCMS.Data.CommonHelper.Function.FunctionEnum.SysFun_UserAdmin_MerchantEdit)]
        public override ActionResult UpdateSubmit(FormCollection fm)
        {
            base.UpdateSubmit(fm);
            XCLCMS.View.AdminWeb.Models.Merchant.MerchantAddVM viewModel = this.GetViewModel(fm);

            var model = new XCLCMS.Data.Model.Merchant();
            model.MerchantID = XCLNetTools.StringHander.FormHelper.GetLong("merchantId");
            model.Address = viewModel.Merchant.Address;
            model.ContactName = viewModel.Merchant.ContactName;
            model.Domain = viewModel.Merchant.Domain;
            model.Email = viewModel.Merchant.Email;
            model.Landline = viewModel.Merchant.Landline;
            model.LogoURL = viewModel.Merchant.LogoURL;
            model.MerchantName = viewModel.Merchant.MerchantName;
            model.MerchantRemark = viewModel.Merchant.MerchantRemark;
            model.MerchantState = viewModel.Merchant.MerchantState;
            model.FK_MerchantType = viewModel.Merchant.FK_MerchantType;
            model.OtherContact = viewModel.Merchant.OtherContact;
            model.PassNumber = viewModel.Merchant.PassNumber;
            model.FK_PassType = viewModel.Merchant.FK_PassType;
            model.QQ = viewModel.Merchant.QQ;
            model.RegisterTime = viewModel.Merchant.RegisterTime;
            model.Remark = viewModel.Merchant.Remark;
            model.Tel = viewModel.Merchant.Tel;
            model.MerchantSystemType = viewModel.Merchant.MerchantSystemType;
            model.RecordState = viewModel.Merchant.RecordState;

            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<XCLCMS.Data.Model.Merchant>(base.UserToken);
            request.Body = model;
            var response = XCLCMS.Lib.WebAPI.MerchantAPI.Update(request);

            return Json(response);
        }

        [HttpPost]
        [XCLCMS.Lib.Filters.FunctionFilter(Function = XCLCMS.Data.CommonHelper.Function.FunctionEnum.SysFun_UserAdmin_MerchantDel)]
        public override ActionResult DelByIDSubmit(List<long> ids)
        {
            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<List<long>>(base.UserToken);
            request.Body = ids;
            var response = XCLCMS.Lib.WebAPI.MerchantAPI.Delete(request);
            return Json(response);
        }

        [HttpGet]
        public ActionResult IsExistMerchantName([System.Web.Http.FromUri] XCLCMS.Data.WebAPIEntity.RequestEntity.Merchant.IsExistMerchantNameEntity condition)
        {
            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<XCLCMS.Data.WebAPIEntity.RequestEntity.Merchant.IsExistMerchantNameEntity>(base.UserToken);
            request.Body = condition;
            var response = XCLCMS.Lib.WebAPI.MerchantAPI.IsExistMerchantName(request);
            return Json(response, JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public ActionResult AllTextValueList()
        {
            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<object>(base.UserToken);
            request.Body = new object();
            var response = XCLCMS.Lib.WebAPI.MerchantAPI.AllTextValueList(request);
            return Json(response, JsonRequestBehavior.AllowGet);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <servlet>
        <servlet-name>springmvc</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
</web-app>

redpajama_set_name: RedPajamaGithub


text:
#pragma once
#include <aws/eks/EKS_EXPORTS.h>
#include <aws/eks/EKSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/eks/model/ResolveConflicts.h>
#include <utility>
#include <aws/core/utils/UUID.h>

namespace Aws
{
namespace EKS
{
namespace Model
{

  /**
   */
  class AWS_EKS_API UpdateAddonRequest : public EKSRequest
  {
  public:
    UpdateAddonRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "UpdateAddon"; }

    Aws::String SerializePayload() const override;

    /**
     *
The name of the cluster.

     */
    inline const Aws::String& GetClusterName() const{ return m_clusterName; }

    /**
     *
The name of the cluster.

     */
    inline bool ClusterNameHasBeenSet() const { return m_clusterNameHasBeenSet; }

    /**
     *
The name of the cluster.

     */
    inline void SetClusterName(const Aws::String& value) { m_clusterNameHasBeenSet = true; m_clusterName = value; }

    /**
     *
The name of the cluster.

     */
    inline void SetClusterName(Aws::String&& value) { m_clusterNameHasBeenSet = true; m_clusterName = std::move(value); }

    /**
     *
The name of the cluster.

     */
    inline void SetClusterName(const char* value) { m_clusterNameHasBeenSet = true; m_clusterName.assign(value); }

    /**
     *
The name of the cluster.

     */
    inline UpdateAddonRequest& WithClusterName(const Aws::String& value) { SetClusterName(value); return *this;}

    /**
     *
The name of the cluster.

     */
    inline UpdateAddonRequest& WithClusterName(Aws::String&& value) { SetClusterName(std::move(value)); return *this;}

    /**
     *
The name of the cluster.

     */
    inline UpdateAddonRequest& WithClusterName(const char* value) { SetClusterName(value); return *this;}

    /**
     *
The name of the add-on. The name must match one of the names returned by
     * ListAddons .

     */
    inline const Aws::String& GetAddonName() const{ return m_addonName; }

    /**
     *
The name of the add-on. The name must match one of the names returned by
     * ListAddons .

     */
    inline bool AddonNameHasBeenSet() const { return m_addonNameHasBeenSet; }

    /**
     *
The name of the add-on. The name must match one of the names returned by
     * ListAddons .

     */
    inline void SetAddonName(const Aws::String& value) { m_addonNameHasBeenSet = true; m_addonName = value; }

    /**
     *
The name of the add-on. The name must match one of the names returned by
     * ListAddons .

     */
    inline void SetAddonName(Aws::String&& value) { m_addonNameHasBeenSet = true; m_addonName = std::move(value); }

    /**
     *
The name of the add-on. The name must match one of the names returned by
     * ListAddons .

     */
    inline void SetAddonName(const char* value) { m_addonNameHasBeenSet = true; m_addonName.assign(value); }

    /**
     *
The name of the add-on. The name must match one of the names returned by
     * ListAddons .

     */
    inline UpdateAddonRequest& WithAddonName(const Aws::String& value) { SetAddonName(value); return *this;}

    /**
     *
The name of the add-on. The name must match one of the names returned by
     * ListAddons .

     */
    inline UpdateAddonRequest& WithAddonName(Aws::String&& value) { SetAddonName(std::move(value)); return *this;}

    /**
     *
The name of the add-on. The name must match one of the names returned by
     * ListAddons .

     */
    inline UpdateAddonRequest& WithAddonName(const char* value) { SetAddonName(value); return *this;}

    /**
     *
The version of the add-on. The version must match one of the versions
     * returned by
     * DescribeAddonVersions .

     */
    inline const Aws::String& GetAddonVersion() const{ return m_addonVersion; }

    /**
     *
The version of the add-on. The version must match one of the versions
     * returned by
     * DescribeAddonVersions .

     */
    inline bool AddonVersionHasBeenSet() const { return m_addonVersionHasBeenSet; }

    /**
     *
The version of the add-on. The version must match one of the versions
     * returned by
     * DescribeAddonVersions .

     */
    inline void SetAddonVersion(const Aws::String& value) { m_addonVersionHasBeenSet = true; m_addonVersion = value; }

    /**
     *
The version of the add-on. The version must match one of the versions
     * returned by
     * DescribeAddonVersions .

     */
    inline void SetAddonVersion(Aws::String&& value) { m_addonVersionHasBeenSet = true; m_addonVersion = std::move(value); }

    /**
     *
The version of the add-on. The version must match one of the versions
     * returned by
     * DescribeAddonVersions .

     */
    inline void SetAddonVersion(const char* value) { m_addonVersionHasBeenSet = true; m_addonVersion.assign(value); }

    /**
     *
The version of the add-on. The version must match one of the versions
     * returned by
     * DescribeAddonVersions .

     */
    inline UpdateAddonRequest& WithAddonVersion(const Aws::String& value) { SetAddonVersion(value); return *this;}

    /**
     *
The version of the add-on. The version must match one of the versions
     * returned by
     * DescribeAddonVersions .

     */
    inline UpdateAddonRequest& WithAddonVersion(Aws::String&& value) { SetAddonVersion(std::move(value)); return *this;}

    /**
     *
The version of the add-on. The version must match one of the versions
     * returned by
     * DescribeAddonVersions .

     */
    inline UpdateAddonRequest& WithAddonVersion(const char* value) { SetAddonVersion(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of an existing IAM role to bind to the
     * add-on's service account. The role must be assigned the IAM permissions required
     * by the add-on. If you don't specify an existing IAM role, then the add-on uses
     * the permissions assigned to the node IAM role. For more information, see Amazon
     * EKS node IAM role in the Amazon EKS User Guide.

To
     * specify an existing IAM role, you must have an IAM OpenID Connect (OIDC)
     * provider created for your cluster. For more information, see Enabling
     * IAM roles for service accounts on your cluster in the Amazon EKS User
     * Guide.

     */
    inline const Aws::String& GetServiceAccountRoleArn() const{ return m_serviceAccountRoleArn; }

    /**
     *
The Amazon Resource Name (ARN) of an existing IAM role to bind to the
     * add-on's service account. The role must be assigned the IAM permissions required
     * by the add-on. If you don't specify an existing IAM role, then the add-on uses
     * the permissions assigned to the node IAM role. For more information, see Amazon
     * EKS node IAM role in the Amazon EKS User Guide.

To
     * specify an existing IAM role, you must have an IAM OpenID Connect (OIDC)
     * provider created for your cluster. For more information, see Enabling
     * IAM roles for service accounts on your cluster in the Amazon EKS User
     * Guide.

     */
    inline bool ServiceAccountRoleArnHasBeenSet() const { return m_serviceAccountRoleArnHasBeenSet; }

    /**
     *
The Amazon Resource Name (ARN) of an existing IAM role to bind to the
     * add-on's service account. The role must be assigned the IAM permissions required
     * by the add-on. If you don't specify an existing IAM role, then the add-on uses
     * the permissions assigned to the node IAM role. For more information, see Amazon
     * EKS node IAM role in the Amazon EKS User Guide.

To
     * specify an existing IAM role, you must have an IAM OpenID Connect (OIDC)
     * provider created for your cluster. For more information, see Enabling
     * IAM roles for service accounts on your cluster in the Amazon EKS User
     * Guide.

     */
    inline void SetServiceAccountRoleArn(const Aws::String& value) { m_serviceAccountRoleArnHasBeenSet = true; m_serviceAccountRoleArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of an existing IAM role to bind to the
     * add-on's service account. The role must be assigned the IAM permissions required
     * by the add-on. If you don't specify an existing IAM role, then the add-on uses
     * the permissions assigned to the node IAM role. For more information, see Amazon
     * EKS node IAM role in the Amazon EKS User Guide.

To
     * specify an existing IAM role, you must have an IAM OpenID Connect (OIDC)
     * provider created for your cluster. For more information, see Enabling
     * IAM roles for service accounts on your cluster in the Amazon EKS User
     * Guide.

     */
    inline void SetServiceAccountRoleArn(Aws::String&& value) { m_serviceAccountRoleArnHasBeenSet = true; m_serviceAccountRoleArn = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) of an existing IAM role to bind to the
     * add-on's service account. The role must be assigned the IAM permissions required
     * by the add-on. If you don't specify an existing IAM role, then the add-on uses
     * the permissions assigned to the node IAM role. For more information, see Amazon
     * EKS node IAM role in the Amazon EKS User Guide.

To
     * specify an existing IAM role, you must have an IAM OpenID Connect (OIDC)
     * provider created for your cluster. For more information, see Enabling
     * IAM roles for service accounts on your cluster in the Amazon EKS User
     * Guide.

     */
    inline void SetServiceAccountRoleArn(const char* value) { m_serviceAccountRoleArnHasBeenSet = true; m_serviceAccountRoleArn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of an existing IAM role to bind to the
     * add-on's service account. The role must be assigned the IAM permissions required
     * by the add-on. If you don't specify an existing IAM role, then the add-on uses
     * the permissions assigned to the node IAM role. For more information, see Amazon
     * EKS node IAM role in the Amazon EKS User Guide.

To
     * specify an existing IAM role, you must have an IAM OpenID Connect (OIDC)
     * provider created for your cluster. For more information, see Enabling
     * IAM roles for service accounts on your cluster in the Amazon EKS User
     * Guide.

     */
    inline UpdateAddonRequest& WithServiceAccountRoleArn(const Aws::String& value) { SetServiceAccountRoleArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of an existing IAM role to bind to the
     * add-on's service account. The role must be assigned the IAM permissions required
     * by the add-on. If you don't specify an existing IAM role, then the add-on uses
     * the permissions assigned to the node IAM role. For more information, see Amazon
     * EKS node IAM role in the Amazon EKS User Guide.

To
     * specify an existing IAM role, you must have an IAM OpenID Connect (OIDC)
     * provider created for your cluster. For more information, see Enabling
     * IAM roles for service accounts on your cluster in the Amazon EKS User
     * Guide.

     */
    inline UpdateAddonRequest& WithServiceAccountRoleArn(Aws::String&& value) { SetServiceAccountRoleArn(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of an existing IAM role to bind to the
     * add-on's service account. The role must be assigned the IAM permissions required
     * by the add-on. If you don't specify an existing IAM role, then the add-on uses
     * the permissions assigned to the node IAM role. For more information, see Amazon
     * EKS node IAM role in the Amazon EKS User Guide.

To
     * specify an existing IAM role, you must have an IAM OpenID Connect (OIDC)
     * provider created for your cluster. For more information, see Enabling
     * IAM roles for service accounts on your cluster in the Amazon EKS User
     * Guide.

     */
    inline UpdateAddonRequest& WithServiceAccountRoleArn(const char* value) { SetServiceAccountRoleArn(value); return *this;}

    /**
     *
How to resolve parameter value conflicts when applying the new version of the
     * add-on to the cluster.

     */
    inline const ResolveConflicts& GetResolveConflicts() const{ return m_resolveConflicts; }

    /**
     *
How to resolve parameter value conflicts when applying the new version of the
     * add-on to the cluster.

     */
    inline bool ResolveConflictsHasBeenSet() const { return m_resolveConflictsHasBeenSet; }

    /**
     *
How to resolve parameter value conflicts when applying the new version of the
     * add-on to the cluster.

     */
    inline void SetResolveConflicts(const ResolveConflicts& value) { m_resolveConflictsHasBeenSet = true; m_resolveConflicts = value; }

    /**
     *
How to resolve parameter value conflicts when applying the new version of the
     * add-on to the cluster.

     */
    inline void SetResolveConflicts(ResolveConflicts&& value) { m_resolveConflictsHasBeenSet = true; m_resolveConflicts = std::move(value); }

    /**
     *
How to resolve parameter value conflicts when applying the new version of the
     * add-on to the cluster.

     */
    inline UpdateAddonRequest& WithResolveConflicts(const ResolveConflicts& value) { SetResolveConflicts(value); return *this;}

    /**
     *
How to resolve parameter value conflicts when applying the new version of the
     * add-on to the cluster.

     */
    inline UpdateAddonRequest& WithResolveConflicts(ResolveConflicts&& value) { SetResolveConflicts(std::move(value)); return *this;}

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline const Aws::String& GetClientRequestToken() const{ return m_clientRequestToken; }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline bool ClientRequestTokenHasBeenSet() const { return m_clientRequestTokenHasBeenSet; }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline void SetClientRequestToken(const Aws::String& value) { m_clientRequestTokenHasBeenSet = true; m_clientRequestToken = value; }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline void SetClientRequestToken(Aws::String&& value) { m_clientRequestTokenHasBeenSet = true; m_clientRequestToken = std::move(value); }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline void SetClientRequestToken(const char* value) { m_clientRequestTokenHasBeenSet = true; m_clientRequestToken.assign(value); }

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline UpdateAddonRequest& WithClientRequestToken(const Aws::String& value) { SetClientRequestToken(value); return *this;}

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline UpdateAddonRequest& WithClientRequestToken(Aws::String&& value) { SetClientRequestToken(std::move(value)); return *this;}

    /**
     *
Unique, case-sensitive identifier that you provide to ensure the idempotency
     * of the request.

     */
    inline UpdateAddonRequest& WithClientRequestToken(const char* value) { SetClientRequestToken(value); return *this;}

  private:

    Aws::String m_clusterName;
    bool m_clusterNameHasBeenSet;

    Aws::String m_addonName;
    bool m_addonNameHasBeenSet;

    Aws::String m_addonVersion;
    bool m_addonVersionHasBeenSet;

    Aws::String m_serviceAccountRoleArn;
    bool m_serviceAccountRoleArnHasBeenSet;

    ResolveConflicts m_resolveConflicts;
    bool m_resolveConflictsHasBeenSet;

    Aws::String m_clientRequestToken;
    bool m_clientRequestTokenHasBeenSet;
  };

} // namespace Model
} // namespace EKS
} // namespace Aws


text:
module Homebrew
  DEFAULT_PREFIX, DEFAULT_REPOSITORY = if OS.mac? && Hardware::CPU.arm?
    [HOMEBREW_MACOS_ARM_DEFAULT_PREFIX, HOMEBREW_MACOS_ARM_DEFAULT_REPOSITORY]
  elsif OS.linux? && !EnvConfig.simulate_macos_on_linux?
    [HOMEBREW_LINUX_DEFAULT_PREFIX, HOMEBREW_LINUX_DEFAULT_REPOSITORY]
  else
    [HOMEBREW_DEFAULT_PREFIX, HOMEBREW_DEFAULT_REPOSITORY]
  end.freeze
end


text:
<?php

namespace ServerGrove\LocaleBundle\EventListener;

use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use ServerGrove\LocaleBundle\Extension\FlagExtension;

/**
 * Class LocaleListener
 *
 * @author Ismael Ambrosi<ismael@servergrove.com>
 */
class LocaleListener
{
    /** @var \ServerGrove\LocaleBundle\Extension\FlagExtension */
    private $extension;

    /**
     * @param \ServerGrove\LocaleBundle\Extension\FlagExtension $extension
     */
    public function __construct(FlagExtension $extension)
    {
        $this->extension = $extension;
    }

    /**
     * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
     */
    public function onKernelRequest(GetResponseEvent $event)
    {
        if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
            return;
        }

        $request = $event->getRequest();

        $this->extension->hideLocale($request->getLocale());

        $languages = array_map(function($language) {
            return strtolower(preg_replace('/[^a-zA-Z]+/', '-', $language));
        }, $request->getLanguages());

        $defaults = array();

        do {
            $language = current($languages);
            $lang     = current(explode('-', $language));

            if (!isset($defaults[$lang]) && $this->extension->forceDefault($language)) {
                $defaults[$lang] = $language;
            }

        } while (next($languages));
    }
}


text:
<?php
namespace specsupport\PSB\Core;

class ParametrizedCallable
{
    public function __invoke($param)
    {
    }
}


text:
/**********
 * Owner: Jothay
 **********/
using System;

namespace Rawr.DPSWarr.Skills
{
    public class ShieldSlam : Ability
    {
        /// <summary>
        /// Instant, 6 sec cd, 20 Rage, Melee Range, Shields (Any)
        /// Slam the target with your shield, causing 990 to 1040 damage, modified by you shield block
        /// value, and dispels 1 magic effect on the target. Also causes a high amount of threat.
        /// </summary>
        /// <TalentsAffecting>
        /// Focused Rage [-(Talents.FocusedRage * 1f) RageCost],
        /// Gag Order [+(5*Pts)% Damage],
        /// OneHandedWeaponSpecialization [+(2*Pts)% Damage]
        /// </TalentsAffecting>
        /// <GlyphsAffecting></GlyphsAffecting>
    }
    public class Revenge : Ability
    {
        /// <summary>
        /// Instant, 1 sec cd, 5 Rage, Melee Range, Melee Weapon (Def)
        /// Instantly counterattack the enemy for 2399 to 2787 damage. Revenge is only usable after the
        /// warrior blocks, dodges or parries an attack.
        /// </summary>
        /// <TalentsAffecting></TalentsAffecting>
        /// <GlyphsAffecting></GlyphsAffecting>
        ///  -(Talents.FocusedRage * 1f) RageCost
        ///  +(10*Pts)% Damage
    }
    public class ConcussionBlow : Ability
    {
        /// <summary>
        /// Instant, 30 sec cd, 12 Rage, Melee Range, Melee Weapon (Any)
        /// Stuns the opponent for 5 sec and deals 2419 damage (based upon attack power).
        /// </summary>
        /// <TalentsAffecting>Concussion Blow [Requires Talent], Focused Rage [-(Talents.FocusedRage * 1f ) Ragecost]</TalentsAffecting>
        /// <GlyphsAffecting></GlyphsAffecting>
    }
    public class Devastate : Ability
    {
        /// <summary>
        /// Instant, No Cd, 12 Rage, Melee Range, 1h Melee Weapon (Any)
        /// Sunder the target's armor causing the Sunder Armor effect. In addition, causes 50% of weapon
        /// damage plus 101 for each application of Sunder Armor on the target. The Sunder Armor effect
        /// can stack up to 5 times.
        /// </summary>
        /// <TalentsAffecting>
        /// Devastate [Requires Talent]
        /// Focused Rage [-(Talents.FocusedRage * 1f) RageCost]
        /// Puncture [-(Talents.Puncture * 1f) RageCost]
        /// Sword and Board [+(5*Pts)% Crit Chance]
        /// </TalentsAffecting>
        /// <GlyphsAffecting>Glyph of Devastate [+1 stack of Sunder Armor]</GlyphsAffecting>
    }
    public class Shockwave : Ability
    {
        /// <summary>
        /// Instant, 20 sec Cd, 12 Rage, (Any)
        /// Sends a wave of force in front of the warrior, causing 2419 damage (based upon attack power)
        /// and stunning all enemy targets within 10 yards in a frontal cone for 4 sec.
        /// </summary>
        /// <TalentsAffecting>Shockwave [Requires Talent], Focused Rage [-(Talents.FocusedRage*1f) RageCost]</TalentsAffecting>
        /// <GlyphsAffecting>Glyph of Shockwave [-3 sec Cd]</GlyphsAffecting>
    }
    public class MockingBlow : Ability
    {
        /// <summary>
        /// Instant, 1 min Cooldown, 10 Rage, Melee Range, Melee Weapon, (Battle/Zerker)
        /// A mocking attack that causes weapon damage, a moderate amount of threat and forces the
        /// target to focus attacks on you for 6 sec.
        /// </summary>
        /// <TalentsAffecting>
        /// Focused Rage [-(Talents.FocusedRage*1f) RageCost]
        /// </TalentsAffecting>
        /// <GlyphsAffecting>
        /// Glyph of Barbaric Insults [+100% Threat]
        /// Glyph of Mocking Blow [+25% Damage]
        /// </GlyphsAffecting>
    }
}


text:
package org.qcri.rheem.tests;

import org.junit.Assert;
import org.junit.Test;
import org.qcri.rheem.basic.data.Tuple2;
import org.qcri.rheem.basic.operators.*;
import org.qcri.rheem.core.api.Job;
import org.qcri.rheem.core.api.RheemContext;
import org.qcri.rheem.core.function.FlatMapDescriptor;
import org.qcri.rheem.core.function.ReduceDescriptor;
import org.qcri.rheem.core.function.TransformationDescriptor;
import org.qcri.rheem.core.optimizer.costs.DefaultLoadEstimator;
import org.qcri.rheem.core.optimizer.costs.LoadEstimator;
import org.qcri.rheem.core.plan.rheemplan.RheemPlan;
import org.qcri.rheem.core.platform.Platform;
import org.qcri.rheem.core.types.DataSetType;
import org.qcri.rheem.core.types.DataUnitType;
import org.qcri.rheem.core.util.Counter;
import org.qcri.rheem.java.Java;
import org.qcri.rheem.java.operators.JavaLocalCallbackSink;
import org.qcri.rheem.java.operators.JavaReduceByOperator;
import org.qcri.rheem.spark.Spark;
import org.qcri.rheem.spark.operators.SparkFlatMapOperator;
import org.qcri.rheem.spark.operators.SparkMapOperator;
import org.qcri.rheem.spark.operators.SparkTextFileSource;

import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;

/**
 * Word count integration test. Besides going through different {@link Platform} combinations, each test addresses a different
 * way of specifying the target {@link Platform}s.
 */
public class WordCountIT {

    @Test
    public void testOnJava() throws URISyntaxException, IOException {
        // Assignment mode: RheemContext.

        // Instantiate Rheem and activate the backend.
        RheemContext rheemContext = new RheemContext().with(Java.basicPlugin());
        TextFileSource textFileSource = new TextFileSource(RheemPlans.FILE_SOME_LINES_TXT.toString());

        // for each line (input) output an iterator of the words
        FlatMapOperator<String, String> flatMapOperator = new FlatMapOperator<>(
                new FlatMapDescriptor<>(line -> Arrays.asList((String[]) line.split(" ")),
                        String.class,
                        String.class
                )
        );
        flatMapOperator.getFunctionDescriptor().setLoadEstimators(
                new DefaultLoadEstimator(1, 1, 0.9d, (inCards, outCards) -> inCards[0] * 670),
                LoadEstimator.createFallback(1, 1)
        );

        // for each word transform it to lowercase and output a key-value pair (word, 1)
        MapOperator<String, Tuple2<String, Integer>> mapOperator = new MapOperator<>(
                new TransformationDescriptor<>(word -> new Tuple2<String, Integer>(word.toLowerCase(), 1),
                        DataUnitType.<String>createBasic(String.class),
                        DataUnitType.<Tuple2<String, Integer>>createBasicUnchecked(Tuple2.class)
                ), DataSetType.createDefault(String.class),
                DataSetType.createDefaultUnchecked(Tuple2.class)
        );
        mapOperator.getFunctionDescriptor().setLoadEstimators(
                new DefaultLoadEstimator(1, 1, 0.9d, (inCards, outCards) -> inCards[0] * 245),
                LoadEstimator.createFallback(1, 1)
        );

        // groupby the key (word) and add up the values (frequency)
        ReduceByOperator<Tuple2<String, Integer>, String> reduceByOperator = new ReduceByOperator<>(
                new TransformationDescriptor<>(pair -> pair.field0,
                        DataUnitType.createBasicUnchecked(Tuple2.class),
                        DataUnitType.createBasic(String.class)), new ReduceDescriptor<>(
                ((a, b) -> {
                    a.field1 += b.field1;
                    return a;
                }), DataUnitType.createGroupedUnchecked(Tuple2.class),
                DataUnitType.createBasicUnchecked(Tuple2.class)
        ), DataSetType.createDefaultUnchecked(Tuple2.class)
        );
        reduceByOperator.getKeyDescriptor().setLoadEstimators(
                new DefaultLoadEstimator(1, 1, 0.9d, (inCards, outCards) -> inCards[0] * 50),
                LoadEstimator.createFallback(1, 1)
        );
        reduceByOperator.getReduceDescriptor().setLoadEstimators(
                new DefaultLoadEstimator(1, 1, 0.9d, (inCards, outCards) -> inCards[0] * 350 + 500000),
                LoadEstimator.createFallback(1, 1)
        );

        // write results to a sink
        List<Tuple2> results = new ArrayList<>();
        LocalCallbackSink<Tuple2> sink = LocalCallbackSink.createCollectingSink(results, DataSetType.createDefault(Tuple2.class));

        // Build Rheem plan by connecting operators
        textFileSource.connectTo(0, flatMapOperator, 0);
        flatMapOperator.connectTo(0, mapOperator, 0);
        mapOperator.connectTo(0, reduceByOperator, 0);
        reduceByOperator.connectTo(0, sink, 0);

        // Have Rheem execute the plan.
        rheemContext.execute(new RheemPlan(sink));

        // Verify the plan result.
        Counter<String> counter = new Counter<>();
        List<Tuple2> correctResults = new ArrayList<>();
        final List<String> lines = Files.lines(Paths.get(RheemPlans.FILE_SOME_LINES_TXT)).collect(Collectors.toList());
        lines.stream()
                .flatMap(line -> Arrays.stream(line.split("\\s+")))
                .map(String::toLowerCase)
                .forEach(counter::increment);

        for (Map.Entry<String, Integer> countEntry : counter) {
            correctResults.add(new Tuple2<>(countEntry.getKey(), countEntry.getValue()));
        }
        Assert.assertTrue(results.size() == correctResults.size() && results.containsAll(correctResults) && correctResults.containsAll(results));
    }

    @Test
    public void testOnSpark() throws URISyntaxException, IOException {
        // Assignment mode: Job.

        TextFileSource textFileSource = new TextFileSource(RheemPlans.FILE_SOME_LINES_TXT.toString());

        // for each line (input) output an iterator of the words
        FlatMapOperator<String, String> flatMapOperator = new FlatMapOperator<>(
                new FlatMapDescriptor<>(line -> Arrays.asList((String[]) line.split(" ")),
                        String.class,
                        String.class
                )
        );

        // for each word transform it to lowercase and output a key-value pair (word, 1)
        MapOperator<String, Tuple2<String, Integer>> mapOperator = new MapOperator<>(
                new TransformationDescriptor<>(word -> new Tuple2<String, Integer>(word.toLowerCase(), 1),
                        DataUnitType.createBasic(String.class),
                        DataUnitType.createBasicUnchecked(Tuple2.class)
                ), DataSetType.createDefault(String.class),
                DataSetType.createDefaultUnchecked(Tuple2.class)
        );

        // groupby the key (word) and add up the values (frequency)
        ReduceByOperator<Tuple2<String, Integer>, String> reduceByOperator = new ReduceByOperator<>(
                new TransformationDescriptor<>(pair -> pair.field0,
                        DataUnitType.createBasicUnchecked(Tuple2.class),
                        DataUnitType.createBasic(String.class)), new ReduceDescriptor<>(
                ((a, b) -> {
                    a.field1 += b.field1;
                    return a;
                }), DataUnitType.createGroupedUnchecked(Tuple2.class),
                DataUnitType.createBasicUnchecked(Tuple2.class)
        ), DataSetType.createDefaultUnchecked(Tuple2.class)
        );

        // write results to a sink
        List<Tuple2> results = new ArrayList<>();
        LocalCallbackSink<Tuple2> sink = LocalCallbackSink.createCollectingSink(results, DataSetType.createDefault(Tuple2.class));

        // Build Rheem plan by connecting operators
        textFileSource.connectTo(0, flatMapOperator, 0);
        flatMapOperator.connectTo(0, mapOperator, 0);
        mapOperator.connectTo(0, reduceByOperator, 0);
        reduceByOperator.connectTo(0, sink, 0);
        RheemPlan rheemPlan = new RheemPlan(sink);

        // Have Rheem execute the plan.
        RheemContext rheemContext = new RheemContext();
        final Job job = rheemContext.createJob(null, rheemPlan);
        Spark.basicPlugin().configure(job.getConfiguration());
        job.execute();

        // Verify the plan result.
        Counter<String> counter = new Counter<>();
        List<Tuple2> correctResults = new ArrayList<>();
        final List<String> lines = Files.lines(Paths.get(RheemPlans.FILE_SOME_LINES_TXT)).collect(Collectors.toList());
        lines.stream()
                .flatMap(line -> Arrays.stream(line.split("\\s+")))
                .map(String::toLowerCase)
                .forEach(counter::increment);

        for (Map.Entry<String, Integer> countEntry : counter) {
            correctResults.add(new Tuple2<>(countEntry.getKey(), countEntry.getValue()));
        }
        Assert.assertTrue(results.size() == correctResults.size() && results.containsAll(correctResults) && correctResults.containsAll(results));
    }

    @Test
    public void testOnSparkToJava() throws URISyntaxException, IOException {
        // Assignment mode: ExecutionOperators.

        // Instantiate Rheem and activate the backend.
        RheemContext rheemContext = new RheemContext();
        rheemContext.register(Spark.basicPlugin());
        rheemContext.register(Java.basicPlugin());

        TextFileSource textFileSource = new SparkTextFileSource(RheemPlans.FILE_SOME_LINES_TXT.toString());

        // for each line (input) output an iterator of the words
        FlatMapOperator<String, String> flatMapOperator = new SparkFlatMapOperator<>(
                DataSetType.createDefault(String.class),
                DataSetType.createDefault(String.class),
                new FlatMapDescriptor<>(line -> Arrays.asList(line.split(" ")),
                        String.class,
                        String.class
                ));

        // for each word transform it to lowercase and output a key-value pair (word, 1)
        MapOperator<String, Tuple2<String, Integer>> mapOperator = new SparkMapOperator<>(
                DataSetType.createDefault(String.class),
                DataSetType.createDefaultUnchecked(Tuple2.class),
                new TransformationDescriptor<>(word -> new Tuple2<>(word.toLowerCase(), 1),
                        DataUnitType.createBasic(String.class),
                        DataUnitType.createBasicUnchecked(Tuple2.class)
                ));

        // groupby the key (word) and add up the values (frequency)
        ReduceByOperator<Tuple2<String, Integer>, String> reduceByOperator = new JavaReduceByOperator<>(
                DataSetType.createDefaultUnchecked(Tuple2.class),
                new TransformationDescriptor<>(pair -> pair.field0,
                        DataUnitType.createBasicUnchecked(Tuple2.class),
                        DataUnitType.createBasic(String.class)),
                new ReduceDescriptor<>(
                        ((a, b) -> {
                            a.field1 += b.field1;
                            return a;
                        }), DataUnitType.createGroupedUnchecked(Tuple2.class),
                        DataUnitType.createBasicUnchecked(Tuple2.class)
                )
        );

        // write results to a sink
        List<Tuple2> results = new ArrayList<>();
        LocalCallbackSink<Tuple2> sink = new JavaLocalCallbackSink<>(results::add, DataSetType.createDefault(Tuple2.class));

        // Build Rheem plan by connecting operators
        textFileSource.connectTo(0, flatMapOperator, 0);
        flatMapOperator.connectTo(0, mapOperator, 0);
        mapOperator.connectTo(0, reduceByOperator, 0);
        reduceByOperator.connectTo(0, sink, 0);
        RheemPlan rheemPlan = new RheemPlan(sink);

        // Have Rheem execute the plan.
        rheemContext.execute(rheemPlan);

        // Verify the plan result.
        Counter<String> counter = new Counter<>();
        List<Tuple2> correctResults = new ArrayList<>();
        final List<String> lines = Files.lines(Paths.get(RheemPlans.FILE_SOME_LINES_TXT)).collect(Collectors.toList());
        lines.stream()
                .flatMap(line -> Arrays.stream(line.split("\\s+")))
                .map(String::toLowerCase)
                .forEach(counter::increment);

        for (Map.Entry<String, Integer> countEntry : counter) {
            correctResults.add(new Tuple2<>(countEntry.getKey(), countEntry.getValue()));
        }
        Assert.assertTrue(results.size() == correctResults.size() && results.containsAll(correctResults) && correctResults.containsAll(results));
    }

    @Test
    public void testOnJavaToSpark() throws URISyntaxException, IOException {
        // Assignment mode: Constraints.

        TextFileSource textFileSource = new TextFileSource(RheemPlans.FILE_SOME_LINES_TXT.toString());
        textFileSource.addTargetPlatform(Java.platform());

        // for each line (input) output an iterator of the words
        FlatMapOperator<String, String> flatMapOperator = new FlatMapOperator<>(
                new FlatMapDescriptor<>(line -> Arrays.asList((String[]) line.split(" ")),
                        String.class,
                        String.class
                )
        );
        flatMapOperator.addTargetPlatform(Java.platform());
        flatMapOperator.setName("Split words");

        // for each word transform it to lowercase and output a key-value pair (word, 1)
        MapOperator<String, Tuple2<String, Integer>> mapOperator = new MapOperator<>(
                new TransformationDescriptor<>(word -> new Tuple2<>(word.toLowerCase(), 1),
                        DataUnitType.createBasic(String.class),
                        DataUnitType.createBasicUnchecked(Tuple2.class)
                ), DataSetType.createDefault(String.class),
                DataSetType.createDefaultUnchecked(Tuple2.class)
        );
        mapOperator.addTargetPlatform(Spark.platform());
        mapOperator.setName("Create counters");

        // groupby the key (word) and add up the values (frequency)
        ReduceByOperator<Tuple2<String, Integer>, String> reduceByOperator = new ReduceByOperator<>(
                new TransformationDescriptor<>(pair -> pair.field0,
                        DataUnitType.createBasicUnchecked(Tuple2.class),
                        DataUnitType.createBasic(String.class)), new ReduceDescriptor<>(
                ((a, b) -> {
                    a.field1 += b.field1;
                    return a;
                }), DataUnitType.createGroupedUnchecked(Tuple2.class),
                DataUnitType.createBasicUnchecked(Tuple2.class)
        ), DataSetType.createDefaultUnchecked(Tuple2.class)
        );
        reduceByOperator.addTargetPlatform(Spark.platform());
        reduceByOperator.setName("Add counters");

        // write results to a sink
        List<Tuple2> results = new ArrayList<>();
        LocalCallbackSink<Tuple2> sink = LocalCallbackSink.createCollectingSink(results, DataSetType.createDefault(Tuple2.class));
        sink.addTargetPlatform(Spark.platform());

        // Build Rheem plan by connecting operators
        textFileSource.connectTo(0, flatMapOperator, 0);
        flatMapOperator.connectTo(0, mapOperator, 0);
        mapOperator.connectTo(0, reduceByOperator, 0);
        reduceByOperator.connectTo(0, sink, 0);
        RheemPlan rheemPlan = new RheemPlan(sink);

        // Have Rheem execute the plan.
        RheemContext rheemContext = new RheemContext();
        rheemContext.register(Java.basicPlugin());
        rheemContext.register(Spark.basicPlugin());
        rheemContext.execute(rheemPlan);

        // Verify the plan result.
        Counter<String> counter = new Counter<>();
        List<Tuple2> correctResults = new ArrayList<>();
        final List<String> lines = Files.lines(Paths.get(RheemPlans.FILE_SOME_LINES_TXT)).collect(Collectors.toList());
        lines.stream()
                .flatMap(line -> Arrays.stream(line.split("\\s+")))
                .map(String::toLowerCase)
                .forEach(counter::increment);

        for (Map.Entry<String, Integer> countEntry : counter) {
            correctResults.add(new Tuple2<>(countEntry.getKey(), countEntry.getValue()));
        }
        Assert.assertEquals(new HashSet<>(correctResults), new HashSet<>(results));
    }

    @Test
    public void testOnJavaAndSpark() throws URISyntaxException, IOException {
        // Assignment mode: none.

        TextFileSource textFileSource = new TextFileSource(RheemPlans.FILE_SOME_LINES_TXT.toString());
        textFileSource.addTargetPlatform(Java.platform());
        textFileSource.addTargetPlatform(Spark.platform());

        // for each line (input) output an iterator of the words
        FlatMapOperator<String, String> flatMapOperator = new FlatMapOperator<>(
                new FlatMapDescriptor<>(line -> Arrays.asList((String[]) line.split(" ")),
                        String.class,
                        String.class
                )
        );

        // for each word transform it to lowercase and output a key-value pair (word, 1)
        MapOperator<String, Tuple2<String, Integer>> mapOperator = new MapOperator<>(
                new TransformationDescriptor<>(word -> new Tuple2<String, Integer>(word.toLowerCase(), 1),
                        DataUnitType.createBasic(String.class),
                        DataUnitType.createBasicUnchecked(Tuple2.class)
                ), DataSetType.createDefault(String.class),
                DataSetType.createDefaultUnchecked(Tuple2.class)
        );

        // groupby the key (word) and add up the values (frequency)
        ReduceByOperator<Tuple2<String, Integer>, String> reduceByOperator = new ReduceByOperator<>(
                new TransformationDescriptor<>(pair -> pair.field0,
                        DataUnitType.createBasicUnchecked(Tuple2.class),
                        DataUnitType.createBasic(String.class)), new ReduceDescriptor<>(
                ((a, b) -> {
                    a.field1 += b.field1;
                    return a;
                }), DataUnitType.createGroupedUnchecked(Tuple2.class),
                DataUnitType.createBasicUnchecked(Tuple2.class)
        ), DataSetType.createDefaultUnchecked(Tuple2.class)
        );

        // write results to a sink
        List<Tuple2> results = new ArrayList<>();
        LocalCallbackSink<Tuple2> sink = LocalCallbackSink.createCollectingSink(results, DataSetType.createDefault(Tuple2.class));

        // Build Rheem plan by connecting operators
        textFileSource.connectTo(0, flatMapOperator, 0);
        flatMapOperator.connectTo(0, mapOperator, 0);
        mapOperator.connectTo(0, reduceByOperator, 0);
        reduceByOperator.connectTo(0, sink, 0);
        RheemPlan rheemPlan = new RheemPlan(sink);

        // Have Rheem execute the plan.
        RheemContext rheemContext = new RheemContext();
        rheemContext.register(Java.basicPlugin());
        rheemContext.register(Spark.basicPlugin());
        rheemContext.execute(rheemPlan);

        // Verify the plan result.
        Counter<String> counter = new Counter<>();
        List<Tuple2> correctResults = new ArrayList<>();
        final List<String> lines = Files.lines(Paths.get(RheemPlans.FILE_SOME_LINES_TXT)).collect(Collectors.toList());
        lines.stream()
                .flatMap(line -> Arrays.stream(line.split("\\s+")))
                .map(String::toLowerCase)
                .forEach(counter::increment);

        for (Map.Entry<String, Integer> countEntry : counter) {
            correctResults.add(new Tuple2<>(countEntry.getKey(), countEntry.getValue()));
        }
        Assert.assertTrue(results.size() == correctResults.size() && results.containsAll(correctResults) && correctResults.containsAll(results));
    }

}


text:
package org.schema.api.model.thing.action.organizeAction.allocateAction;

import org.schema.api.model.thing.intangible.enumeration.medicalEnumeration.MedicalDevicePurpose;

public class RejectAction extends AllocateAction
{
	private MedicalDevicePurpose purpose;//Notes - Allowed types- [MedicalDevicePurpose, Thing]

	public MedicalDevicePurpose getPurpose()
	{
		return purpose;
	}

	public void setPurpose(MedicalDevicePurpose purpose)
	{
		this.purpose = purpose;
	}
}


text:
package com.amazonaws.services.simpleemail.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *

 * A receipt IP address filter enables you to specify whether to accept or reject mail originating from an IP address or
 * range of IP addresses.
 *

 *

 * For information about setting up IP address filters, see the Amazon SES Developer
 * Guide.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReceiptFilter implements Serializable, Cloneable {

    /**
     *

     * The name of the IP address filter. The name must:
     *

     *

     *

     *

     * This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-).
     *

     *

     *

     *

     * Start and end with a letter or number.
     *

     *

     *

     *

     * Contain less than 64 characters.
     *

     *

     *

     */
    private String name;
    /**
     *

     * A structure that provides the IP addresses to block or allow, and whether to block or allow incoming mail from
     * them.
     *

     */
    private ReceiptIpFilter ipFilter;

    /**
     *

     * The name of the IP address filter. The name must:
     *

     *

     *

     *

     * This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-).
     *

     *

     *

     *

     * Start and end with a letter or number.
     *

     *

     *

     *

     * Contain less than 64 characters.
     *

     *

     *

     *
     * @param name
     *        The name of the IP address filter. The name must:

     *

     *

     *

     *        This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-).
     *

     *

     *

     *

     *        Start and end with a letter or number.
     *

     *

     *

     *

     *        Contain less than 64 characters.
     *

     *

     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     *

     * The name of the IP address filter. The name must:
     *

     *

     *

     *

     * This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-).
     *

     *

     *

     *

     * Start and end with a letter or number.
     *

     *

     *

     *

     * Contain less than 64 characters.
     *

     *

     *

     *
     * @return The name of the IP address filter. The name must:

     *

     *

     *

     *         This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-).
     *

     *

     *

     *

     *         Start and end with a letter or number.
     *

     *

     *

     *

     *         Contain less than 64 characters.
     *

     *

     */

    public String getName() {
        return this.name;
    }

    /**
     *

     * The name of the IP address filter. The name must:
     *

     *

     *

     *

     * This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-).
     *

     *

     *

     *

     * Start and end with a letter or number.
     *

     *

     *

     *

     * Contain less than 64 characters.
     *

     *

     *

     *
     * @param name
     *        The name of the IP address filter. The name must:

     *

     *

     *

     *        This value can only contain ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-).
     *

     *

     *

     *

     *        Start and end with a letter or number.
     *

     *

     *

     *

     *        Contain less than 64 characters.
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ReceiptFilter withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * A structure that provides the IP addresses to block or allow, and whether to block or allow incoming mail from
     * them.
     *

     *
     * @param ipFilter
     *        A structure that provides the IP addresses to block or allow, and whether to block or allow incoming mail
     *        from them.
     */

    public void setIpFilter(ReceiptIpFilter ipFilter) {
        this.ipFilter = ipFilter;
    }

    /**
     *

     * A structure that provides the IP addresses to block or allow, and whether to block or allow incoming mail from
     * them.
     *

     *
     * @return A structure that provides the IP addresses to block or allow, and whether to block or allow incoming mail
     *         from them.
     */

    public ReceiptIpFilter getIpFilter() {
        return this.ipFilter;
    }

    /**
     *

     * A structure that provides the IP addresses to block or allow, and whether to block or allow incoming mail from
     * them.
     *

     *
     * @param ipFilter
     *        A structure that provides the IP addresses to block or allow, and whether to block or allow incoming mail
     *        from them.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ReceiptFilter withIpFilter(ReceiptIpFilter ipFilter) {
        setIpFilter(ipFilter);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getIpFilter() != null)
            sb.append("IpFilter: ").append(getIpFilter());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ReceiptFilter == false)
            return false;
        ReceiptFilter other = (ReceiptFilter) obj;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getIpFilter() == null ^ this.getIpFilter() == null)
            return false;
        if (other.getIpFilter() != null && other.getIpFilter().equals(this.getIpFilter()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getIpFilter() == null) ? 0 : getIpFilter().hashCode());
        return hashCode;
    }

    @Override
    public ReceiptFilter clone() {
        try {
            return (ReceiptFilter) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}