Add a sink implementation to Suro.  typeName is the expected value of the
'type' field of a JSON configuration.

@param typeName
@param sinkClass
960979
public <T extends Sink> void addSinkType(String typeName, Class<T> sinkClass) {
        LOG.info("Adding sinkType: " + typeName + " -> " + sinkClass.getCanonicalName());
        
        Multibinder<TypeHolder> bindings
            = Multibinder.newSetBinder(binder(), TypeHolder.class);
        bindings.addBinding().toInstance(new TypeHolder(typeName, sinkClass));
    }
445720
protected <T> Class<T> getType(String typeName) throws PluginRepositoryException {
        try {
            return (Class<T>) classLoader.loadClass(typeName.trim());
        } catch (ClassNotFoundException | LinkageError e) {
            // Catching class loader related errors for logging a message which plugin class
            // actually caused the problem.
            throw new PluginRepositoryException("Cannot find or load class " + typeName, e);
        }
    }
1281540
public function create(string $className, string $typeName): Type
    {
        $type = new InputObjectType([
            'name' => $typeName,
            'description' => 'Type to specify conditions on fields',
            'fields' => function () use ($className, $typeName): array {
                $filters = [];
                $metadata = $this->entityManager->getClassMetadata($className);

                // Get custom operators
                $this->readCustomOperatorsFromAnnotation($metadata->reflClass);

                // Get all scalar fields
                foreach ($metadata->fieldMappings as $mapping) {
                    if ($mapping['id'] ?? false) {
                        $leafType = Type::id();
                    } else {
                        /** @var LeafType $leafType */
                        $leafType = $this->types->get($mapping['type']);
                    }

                    $fieldName = $mapping['fieldName'];
                    $operators = $this->getOperators($fieldName, $leafType, false, false);

                    $filters[] = $this->getFieldConfiguration($typeName, $fieldName, $operators);
                }

                // Get all collection fields
                foreach ($metadata->associationMappings as $mapping) {
                    $fieldName = $mapping['fieldName'];
                    $operators = $this->getOperators($fieldName, Type::id(), true, $metadata->isCollectionValuedAssociation($fieldName));

                    $filters[] = $this->getFieldConfiguration($typeName, $fieldName, $operators);
                }

                // Get all custom fields defined by custom operators
                foreach ($this->customOperators as $fieldName => $customOperators) {
                    $operators = [];
                    /** @var Filter $customOperator */
                    foreach ($customOperators as $customOperator) {
                        /** @var LeafType $leafType */
                        $leafType = $this->types->get($customOperator->type);
                        $operators[$customOperator->operator] = $leafType;
                    }

                    $filters[] = $this->getFieldConfiguration($typeName, $fieldName, $operators);
                }

                return $filters;
            },
        ]);

        return $type;
    }
1046403
@Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
        for (Class<?> t = type.getRawType(); (t != Object.class) && (t.getSuperclass() != null); t = t.getSuperclass()) {
            for (Method m : t.getDeclaredMethods()) {
                if (m.isAnnotationPresent(PostConstruct.class)) {
                    m.setAccessible(true);
                    TypeAdapter<T> delegate = gson.getDelegateAdapter(this, type);
                    return new PostConstructAdapter<T>(delegate, m);
                }
            }
        }
        return null;
    }
759747
@NonNull
  public static Drop dropType(@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier typeName) {
    return new DefaultDrop(keyspace, typeName, "TYPE");
  }
133157
@SuppressWarnings("unchecked")
  public <S, D> TypeMap<S, D> get(Class<S> sourceType, Class<D> destinationType, String typeMapName) {
    TypeMap<S, D> typeMap = (TypeMap<S, D>) typeMaps.get(TypePair.of(sourceType, destinationType, typeMapName));
    if (typeMap != null)
      return typeMap;

    for (TypePair<?, ?> typePair : getPrimitiveWrapperTypePairs(sourceType, destinationType, typeMapName)) {
      typeMap = (TypeMap<S, D>) typeMaps.get(typePair);
      if (typeMap != null)
        return typeMap;
    }

    return null;
  }
688749
@Override
    public void constructorFactory(Sink sink, String dataTypeName, String factoryName, List<String> typeParametrs, Constructor constructor) {
        if (constructor.args.isEmpty()) {
        	if (typeParametrs.isEmpty()) {
            	logger.finest("Generating no args, no types factory for " + constructor.name);
        	} else {
            	logger.finest("Generating no args, type arguments factory for " + constructor.name);
        		sink.write("   @SuppressWarnings(\"rawtypes\")\n");
        	}
            sink.write("   private static final " + dataTypeName + " _" + factoryName + " = new " + constructor.name + "();\n");
            sink.write(ASTPrinter.printComments("   ", commentProcessor.leftAlign(commentProcessor.javaDocOnly(constructor.comments))));
        	if (!typeParametrs.isEmpty()) {
        		sink.write("   @SuppressWarnings(\"unchecked\")\n");
        	}
        	sink.write("   public static final ");
        	emitParameterizedTypeName(sink, typeParametrs);
        	sink.write(" ");
        	sink.write(dataTypeName);
        	emitParameterizedTypeName(sink, typeParametrs);
        	sink.write(" _" + factoryName + "() { return _" + factoryName + "; }");
        } else {
        	logger.finest("Generating args factory for " + constructor.name);
            sink.write(ASTPrinter.printComments("   ", commentProcessor.leftAlign(constructor.comments)));
            sink.write("   public static final ");
            emitParameterizedTypeName(sink, typeParametrs);
        	sink.write(" ");
        	sink.write(dataTypeName);
            emitParameterizedTypeName(sink, typeParametrs);
            sink.write(" _" + factoryName + "(");
            constructorArgs(sink, constructor, true);
            sink.write(") { return new " + constructor.name);
            emitParameterizedTypeName(sink, typeParametrs);
            sink.write("("); 
            constructorArgs(sink, constructor, false);
            sink.write("); }");            
        }
    }
189064
public <T, V> void addColumn(String name, Class<? extends V> type, 
        Function<T, V> getter)
    {
        addColumn(name, type, getter, null);
    }
165986
public void registerJsonValueProcessor( String key, JsonValueProcessor jsonValueProcessor ) {
      if( key != null && jsonValueProcessor != null ) {
         keyMap.put( key, jsonValueProcessor );
      }
   }
247253
public void addType(final UUID... _uuid)
        throws EFapsException
    {
        final Set<Type> typesTmp = new HashSet<>();
        for (final UUID uuid : _uuid) {
            typesTmp.add(Type.get(uuid));
        }
        addType(typesTmp.toArray(new Type[typesTmp.size()]));
    }
478770
public synchronized void add(String logSinkClass)
    {
        try
        {
            if (logSinkClass==null || logSinkClass.length()==0)
                logSinkClass="org.browsermob.proxy.jetty.log.OutputStreamLogSink";
            Class sinkClass =  Loader.loadClass(this.getClass(),logSinkClass);
            LogSink sink=(LogSink)sinkClass.newInstance();
            add(sink);
        }
        catch(Exception e)
        {
            message(WARN,e,2);
            throw new IllegalArgumentException(e.toString());
        }
        
    }
522959
public void registerJsonValueProcessor( Class propertyType, JsonValueProcessor jsonValueProcessor ) {
      if( propertyType != null && jsonValueProcessor != null ) {
         typeMap.put( propertyType, jsonValueProcessor );
      }
   }
1131581
public <T> void put(@NonNull String key, @NonNull T value, @NonNull TypeToken<T> typeTokenOfT) {
    Preconditions.checkNotNull(key, KEY_IS_NULL);
    Preconditions.checkNotNull(value, VALUE_IS_NULL);
    Preconditions.checkNotNull(typeTokenOfT, TYPE_TOKEN_OF_T_IS_NULL);

    if (!accessorProvider.getAccessors().containsKey(value.getClass())) {
      String jsonValue = jsonConverter.toJson(value, typeTokenOfT.getType());
      editor.putString(key, String.valueOf(jsonValue)).apply();
      return;
    }

    Class<?> classOfValue = value.getClass();

    for (Map.Entry<Class<?>, Accessor<?>> entry : accessorProvider.getAccessors().entrySet()) {
      if (classOfValue.equals(entry.getKey())) {
        @SuppressWarnings("unchecked") Accessor<T> accessor = (Accessor<T>) entry.getValue();
        accessor.put(key, value);
      }
    }
  }
252785
@PublicEvolving
	public void add_sink(SinkFunction<PyObject> sink_func) throws IOException {
		stream.addSink(new PythonSinkFunction(sink_func));
	}
223257
public Sink createSinkAsync(String sinkName, String datasetName)
      throws ExecutionException, InterruptedException {
    // [START createSinkAsync]
    SinkInfo sinkInfo = SinkInfo.of(sinkName, DatasetDestination.of(datasetName));
    Future<Sink> future = logging.createAsync(sinkInfo);
    // ...
    Sink sink = future.get();
    // [END createSinkAsync]
    return sink;
  }
1255447
public static boolean matchesTypeName(Class<?> clazz, String typeName) {
		return (typeName != null &&
				(typeName.equals(clazz.getName()) || typeName.equals(clazz.getSimpleName()) ||
				(clazz.isArray() && typeName.equals(getQualifiedNameForArray(clazz)))));
	}
1135486
public <T extends Type> T resolve(String typeName, Class<T> clazz) {
        Type instance = resolve(typeName);
        if (instance == null) {
            return null;
        }
        if (clazz.isAssignableFrom(instance.getClass())) {
            return clazz.cast(instance);
        } else {
            throw new ParserException("Type error: %s of type %s can not be cast to %s",
                    typeName, instance.getClass(), clazz);
        }
    }