Internal method to set the rate chain, which also ensure that the chain
passed, when not null, contains valid elements.

@param chain the chain to set.
429693
private void setExchangeRateChain(List<ExchangeRate> chain) {
        this.chain.clear();
        if (chain==null || chain.isEmpty()) {
            this.chain.add(this);
        } else {
            for (ExchangeRate rate : chain) {
                if (rate==null) {
                    throw new IllegalArgumentException("Rate Chain element can not be null.");
                }
            }
            this.chain.addAll(chain);
        }
    }
543793
public ProviderContextBuilder setRateTypes(Collection<RateType> rateTypes) {
        Objects.requireNonNull(rateTypes);
        if (rateTypes.isEmpty()) {
            throw new IllegalArgumentException("At least one RateType is required.");
        }
        Set<RateType> rtSet = new HashSet<>(rateTypes);
        set(ProviderContext.KEY_RATE_TYPES, rtSet);
        return this;
    }
301207
public final void setUtc(final boolean utc) {
        for (final Period period : this) {
            period.setUtc(utc);
        }
        this.timezone = null;
        this.utc = utc;
    }
1347621
public ExchangeRateBuilder setRateChain(List<ExchangeRate> exchangeRates) {
        this.rateChain.clear();
        if (exchangeRates!=null) {
            this.rateChain.addAll(exchangeRates);
        }
        return this;
    }
717437
@Override
    public synchronized void startChain(String chainName) throws ChannelException, ChainException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "startChain: " + chainName);
        }
        if (null == chainName) {
            throw new InvalidChainNameException("Null chain name");
        }

        // Get the chain configuration
        ChainData chainData = this.chainDataMap.get(chainName);
        if (null == chainData) {
            InvalidChainNameException e = new InvalidChainNameException("Nonexistent chain configuration");
            throw e;
        }

        // Ensure we have an inbound chain.
        if (FlowType.OUTBOUND.equals(chainData.getType())) {
            throw new InvalidChainNameException("Outbound chain cannot use this interface.");
        }

        startChainInternal(chainData);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "startChain");
        }
    }
18852
@Override
    public synchronized boolean isChainRunning(String chainName) {
        boolean rc = false;
        if (null != chainName) {
            Chain c = this.chainRunningMap.get(chainName);
            if (null != c) {
                rc = c.getState().equals(RuntimeState.STARTED) || c.getState().equals(RuntimeState.QUIESCED);
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "isChainRunning: " + chainName + " " + rc);
        }
        return rc;
    }
984354
@Override
	public void setModelInfo(int inputModelNumber,
			int chainCount) {
		modelNumber = inputModelNumber;
		structure.addModel(new ArrayList<Chain>(chainCount));
		chainMap.add(new HashMap<>());
	}
921184
public void setChainEventListeners(Set<ChainEventListener> newListeners) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "removeAllChainEventListeners", newListeners);
        }
        chainEventListeners.clear();
        chainEventListeners.addAll(newListeners);
    }
490081
@Override
    public synchronized void stopChain(String chainName, long millisec) throws ChannelException, ChainException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "stopChain: " + chainName + " time=" + millisec);
        }
        if (null == chainName) {
            throw new InvalidChainNameException("Null chain name");
        }
        if (millisec < 0) {
            throw new ChainTimerException("Invalid time length give to stopChain, " + millisec);
        }

        // Verify the chain is found in the runtime.
        Chain chain = getRunningChain(chainName);
        if (null == chain) {
            // Due to timing windows (i.e. multiple channel providers going away), there is
            // a race to stop chains. This is not a notable condition: the chain can only be stopped
            // once.
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "stopChain " + chainName, "chain is not running");
            }
            return;
        }

        // Ensure we have an inbound chain.
        if (FlowType.OUTBOUND.equals(chain.getChainData().getType())) {
            throw new InvalidChainNameException("Outbound chain cannot use this interface.");
        }

        stopChainInternal(chain, millisec);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "stopChain");
        }
    }
453359
public void setLinked(boolean linked) {
        if (linked != this.linked) {
            this.linked = linked;
            
            if (!initializing) {
                internalDeserialize(true);
                getRoot().activate(true);
            }
        }
    }
1277290
public void setConfigured(boolean value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "enable chain " + this);
        }
        configured = value;
    }
31968
public void setRateType(com.google.api.ads.admanager.axis.v201902.RateType rateType) {
        this.rateType = rateType;
    }
987501
public void updateChain(ChainData inputChain) {
        String chainname = inputChain.getName();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "updateChain: " + chainname);
        }

        // Find the chain in the group.
        for (int i = 0; i < this.chainArray.length; i++) {
            if (chainname.equals(this.chainArray[i].getName())) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Updating chain " + chainname + " in group " + getName());
                }
                // Found the chain. Update the array with the new data.
                this.chainArray[i] = inputChain;
                break;
            }
        }
    }
859937
@Override
    public synchronized void startChain(ChainData chain) throws ChannelException, ChainException {
        String chainName = (null != chain) ? chain.getName() : null;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "startChain: " + chainName);
        }
        if (null == chain) {
            throw new InvalidChainNameException("Null chain");
        }

        // Ensure we have an inbound chain.
        if (FlowType.OUTBOUND.equals(chain.getType())) {
            throw new InvalidChainNameException("Outbound chain cannot use this interface.");
        }

        startChainInternal(chain);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "startChain");
        }
    }
60506
@Override public Response intercept(Chain chain) throws IOException {
    final Response response = chain.proceed(chain.request());

    final Headers headers = response.headers();
    final Map<String, List<String>> mappedHeaders = headers.toMultimap();
    final RateLimits limits = new RateLimits.DefaultParser().parse(mappedHeaders);

    listener.onRateLimitHeaderReceived(limits);

    return response;
  }
269380
public function setChain($chain)
    {
        $chain = func_num_args() > 1 ? func_get_args() : $chain;
        $this->chain = $this->parseChain($chain);

        return $this;
    }
19788
@Override
    public void set(final long value)
    {
        final Sequence[] sequences = this.sequences;
        for (Sequence sequence : sequences)
        {
            sequence.set(value);
        }
    }