Add a loader adapter

@param object    A AnLoaderAdapter
@return void
486051
public static function addAdapter(AnLoaderAdapterInterface $adapter)
    {
        self::$_adapters[$adapter->getType()] = $adapter;
        self::$_prefix_map[$adapter->getPrefix()] = $adapter->getType();
    }
739421
public function loadAdapters()
    {
        $this->paymentAdapters = array();
        foreach ($this->paymentHandler->getAdapters() as $adapterName => $paymentAdapter) {
            $interfaceClass = sprintf(
                '%s\%s\AdapterInterface',
                __NAMESPACE__,
                ucwords($this->getServiceCode())
            );
            if ($paymentAdapter instanceof $interfaceClass) {
                $this->paymentAdapters[$adapterName] = $paymentAdapter;
            }
        }
    }
174033
public function setAdapter($name, AdapterInterface $adapter)
    {
        $this->adapters[$name] = $adapter;
        $this->adapterClasses[$name] = get_class($adapter);
    }
199117
public function addItem($object, ?string $key = null) : void
    {
        $this->checkCallback();

        if (null !== $key) {
            if (isset($this->members[$key])) {
                throw new CollectionException('Unable to add to collection - key ' . $key . ' already used.');
            } else {
                $this->members[$key] = $object;
            }
        } else {
            $this->members[] = $object;
        }
    }
1035457
public function addLoader($id, $loader)
    {
        if (!array_key_exists($id, $this->loaders)) {
            $this->loaders[$id] = $loader;
        }
    }
553734
function createAdapter(type) {
    var adapterConfig = adaptersConfig[type];
    if (!adapterConfig) {
        throw new Error('Adapter type ' + type + ' has not been registered.');
    }
    return new DebugAdapter(adaptersConfig[type], adaptersCwd[type]);
}
182929
protected function registerPostAdapter()
    {
        $this->app->bind('adapter.post', function ($app) {
            return new Post($app['config']);
        });

        $this->app->alias('adapter.post', Post::class);
    }
1068075
function loadAdapters() {
        var adapters = {};
        var adaptersDir = path.join(this.injector.rootDir, this.injector.servicesDir + '/adapters');

        if (!fs.existsSync(adaptersDir)) {
            return this.injector.adapters || {};
        }

        var me = this;
        var adapterNames = fs.readdirSync(adaptersDir);

        _.each(adapterNames, function (adapterName) {
            if (adapterName.substring(adapterName.length - 3) !== '.js') {  // only dirs, not js files
                var adapterImpl = me.injector.adapterMap[adapterName];
                adapterName = utils.getPascalCase(adapterImpl + '.' + adapterName + '.adapter');
                adapters[adapterName] = me.injector.loadModule(adapterName);
            }
        });

        // add the adapters that come from plugins to the list
        _.extend(adapters, this.injector.adapters);

        // return the adapters
        return adapters;
    }
850639
public function addAdaptor(AbstractAdaptor $adaptor)
    {
        // The key will be the adaptor's name or the next numerical
        // count if a name is blank
        $adaptorName = $adaptor->getName() ?: $this->adaptorCount;
        $this->adaptors[$adaptorName] = $adaptor;
        $this->adaptorCount++;
    }
599701
public static void addClassLoaderListener(EnvLoaderListener listener,
                                            ClassLoader loader)
  {
    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
        ((EnvironmentClassLoader) loader).addListener(listener);
        return;
      }
    }
    
    /*
    if (_envSystemClassLoader != null) {
      _envSystemClassLoader.addNotificationListener(listener);
      return;
    }
    */

    _globalLoaderListeners.add(listener);
  }
429528
@Override
    @Trivial
    public void addClassLoader(ClassLoader classLoader) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "addClassLoader - " + classLoader);
        }

        if (classLoader instanceof ContainerClassLoader) {
            synchronized (classLoaders) {
                classLoaders.add((ContainerClassLoader) classLoader);
            }
        } else {
            throw new IllegalArgumentException("classLoader is not a ContainerClassLoader");
        }
    }
598018
function AdapterSingleton (properties) {
  var CustomAdapter, input

  input = Array.isArray(properties.adapter) ?
    properties.adapter : [ properties.adapter ]

  if (typeof input[0] !== 'function')
    throw new TypeError('The adapter must be a function.')

  CustomAdapter = Adapter.prototype
    .isPrototypeOf(input[0].prototype) ? input[0] : input[0](Adapter)

  if (!Adapter.prototype.isPrototypeOf(CustomAdapter.prototype))
    throw new TypeError('The adapter must inherit the Adapter class.')

  return new CustomAdapter({
    options: input[1] || {},
    recordTypes: properties.recordTypes,
    features: CustomAdapter.features,
    common: common,
    errors: errors,
    keys: keys,
    message: properties.message,
    Promise: promise.Promise
  })
}
105171
public function setAdapter($adapter)
    {
        if (\is_callable($adapter)) {
            $adapter = \call_user_func($adapter, $this->container);
        }

        $this->adapter = $adapter;
    }
1078097
protected function _loadAclAdapter($adapter) {
		if (!class_exists($adapter)) {
			throw new Exception(sprintf('The Acl Adapter class "%s" was not found.', $adapter));
		}

		$adapterInstance = new $adapter();
		if (!($adapterInstance instanceof AclAdapterInterface)) {
			throw new InvalidArgumentException(sprintf(
				'TinyAuth Acl adapters have to implement %s.', AclAdapterInterface::class
			));
		}

		return $adapterInstance;
	}
1264134
public function addAdapter($name, CacheItemPoolInterface $adapter, $default = false)
    {
        if (false === is_string($name)) {
            throw CacheException::adapterNameNotString($name);
        }

        if (true === array_key_exists($name, $this->adapters)) {
            throw CacheException::adapterAlreadyExists($name);
        }

        $this->adapters[$name] = $adapter;

        if (true === $default) {
            $this->setDefaultAdapterName($name);
        }
    }
263272
@SuppressWarnings("unchecked")
	public <Input,Output> Adapter<Input,Output> findAdapter(Object in, Class<Input> input, Class<Output> output) {
		ArrayList<Adapter> acceptInput = new ArrayList<>();
		ArrayList<Adapter> matching = new ArrayList<>();
		for (Adapter a : adapters) {
			if (!a.getInputType().isAssignableFrom(input)) continue;
			if (!a.canAdapt(in)) continue;
			acceptInput.add(a);
			if (output.equals(a.getOutputType()))
				return a;
			if (output.isAssignableFrom(a.getOutputType()))
				matching.add(a);
		}
		if (acceptInput.isEmpty())
			return null;
		if (matching.size() == 1)
			return matching.get(0);
		if (!matching.isEmpty())
			return getBest(matching);
		LinkedList<LinkedList<Adapter>> paths = findPathsTo(input, acceptInput, output);
		LinkedList<Adapter> best = null;
		while (!paths.isEmpty()) {
			LinkedList<Adapter> path = paths.removeFirst();
			if (best != null && best.size() <= path.size()) continue;
			Object o = in;
			boolean valid = true;
			int i = 0;
			for (Adapter a : path) {
				if (!a.canAdapt(o)) {
					valid = false;
					break;
				}
				if (i == path.size() - 1)
					break; // we are on the last, so no need to do it
				i++;
				try {
					o = a.adapt(o);
				} catch (Exception e) {
					valid = false;
					break;
				}
			}
			if (valid)
				best = path;
		}
		if (best == null) return null;
		return new LinkedAdapter(best);
	}
1248755
public void setAdapter(PagerAdapter adapter) {
        if (mAdapter != null) {
            mAdapter.unregisterDataSetObserver(mObserver);
            mAdapter.startUpdate(this);
            for (int i = 0; i < mItems.size(); i++) {
                final ItemInfo ii = mItems.get(i);
                mAdapter.destroyItem(this, ii.position, ii.object);
            }
            mAdapter.finishUpdate(this);
            mItems.clear();
            removeNonDecorViews();
            mCurItem = 0;
            scrollTo(0, 0);
        }

        final PagerAdapter oldAdapter = mAdapter;
        mAdapter = adapter;
        mExpectedAdapterCount = 0;

        if (mAdapter != null) {
            if (mObserver == null) {
                mObserver = new PagerObserver();
            }
            mAdapter.registerDataSetObserver(mObserver);
            mPopulatePending = false;
            final boolean wasFirstLayout = mFirstLayout;
            mFirstLayout = true;
            mExpectedAdapterCount = mAdapter.getCount();
            if (mRestoredCurItem >= 0) {
                mAdapter.restoreState(mRestoredAdapterState, mRestoredClassLoader);
                setCurrentItemInternal(mRestoredCurItem, false, true);
                mRestoredCurItem = -1;
                mRestoredAdapterState = null;
                mRestoredClassLoader = null;
            } else if (!wasFirstLayout) {
                populate();
            } else {
                requestLayout();
            }
        }

        if (mAdapterChangeListener != null && oldAdapter != adapter) {
            mAdapterChangeListener.onAdapterChanged(oldAdapter, adapter);
        }
    }