class RuleWeightRandomLoadBalanceAdapter extends AbstractWeightRandomLoadBalanceAdapter<WeightFilterEntity> {
    public RuleWeightRandomLoadBalanceAdapter(PluginAdapter pluginAdapter) {
        super(pluginAdapter);
    }

    @Override
    public WeightFilterEntity getT() {
        RuleEntity ruleEntity = pluginAdapter.getRule();
        if (ruleEntity == null) {
            return null;
        }

        DiscoveryEntity discoveryEntity = ruleEntity.getDiscoveryEntity();
        if (discoveryEntity == null) {
            return null;
        }

        WeightFilterEntity weightFilterEntity = discoveryEntity.getWeightFilterEntity();

        return weightFilterEntity;
    }

    @Override
    public int getWeight(Server server, WeightFilterEntity weightFilterEntity) {<FILL_FUNCTION_BODY>}
}

        String providerServiceId = pluginAdapter.getServerServiceId(server);
        String providerVersion = pluginAdapter.getServerVersion(server);
        String providerRegion = pluginAdapter.getServerRegion(server);
        String serviceId = pluginAdapter.getServiceId();

        return WeightEntityWrapper.getWeight(weightFilterEntity, providerServiceId, providerVersion, providerRegion, serviceId);
    
<methods>public void <init>(com.nepxion.discovery.plugin.framework.adapter.PluginAdapter) ,public void <init>(com.nepxion.discovery.plugin.framework.adapter.PluginAdapter, com.nepxion.discovery.plugin.framework.context.PluginContextHolder) ,public boolean checkWeight(List<Server>, com.nepxion.discovery.common.entity.WeightFilterEntity) ,public abstract com.nepxion.discovery.common.entity.WeightFilterEntity getT() ,public abstract int getWeight(Server, com.nepxion.discovery.common.entity.WeightFilterEntity) <variables>protected com.nepxion.discovery.plugin.framework.adapter.PluginAdapter pluginAdapter,protected com.nepxion.discovery.plugin.framework.context.PluginContextHolder pluginContextHolder