Fluent API building a new instance of ExternalMergeSort<T.
@param serializer Serializer<T> to use when sorting.
@return Config instance that can be used to set options and in the end create a new instance.
357381
public static <T> Builder<T> newSorter(Serializer<T> serializer, Comparator<T> comparator) {
        return new Builder<T>(serializer, comparator);
    }
757004
private function add(JWESerializer $serializer): self
    {
        $this->serializers[$serializer->name()] = $serializer;

        return $this;
    }
1118503
public static <T> LinkedListJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new LinkedListJsonDeserializer<T>( deserializer );
    }
1212882
public CacheConfigurationBuilder<K, V> withKeySerializer(Serializer<K> keySerializer) {
    return withSerializer(new DefaultSerializerConfiguration<>(requireNonNull(keySerializer, "Null key serializer"), DefaultSerializerConfiguration.Type.KEY));
  }
1116605
public static <T> ImmutableMultisetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new ImmutableMultisetJsonDeserializer<T>( deserializer );
    }
1348282
public XmlObjectSerializer setOutput(SerializerContext serializerContext, Writer out) throws SerializerException, IOException
	{
		try
		{
			serializerContext.serializer.setOutput(out);
		}
		catch (IllegalArgumentException e)
		{
			throw new SerializerException("can't configure serializer", e);
		}
		catch (IllegalStateException e)
		{
			throw new SerializerException("can't configure serializer", e);
		}
		return this;
	}
489444
public static <T> CollectionJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new CollectionJsonDeserializer<T>( deserializer );
    }
668195
function createSerializer(serializer) {
  var applyFn = function serializationWrapper(v, cb) {
    try {
      return cb ? serializer(v, cb) : serializer(v);
    } catch (e) {
      var modifiedError = new Error('Could not serialize value: ' + e.message);
      modifiedError.value = v;
      modifiedError.serializer = serializer;
      throw modifiedError;
    }
  };

  // We can check how many parameters the function has and activate the asynchronous
  // operation if the number of parameters the function accepts is > 1
  return {
    apply: applyFn,
    async: serializer.length > 1
  };
}
514973
protected Serializer serializer() {
    if (serializer == null) {
      NamespaceConfig namespaceConfig = this.config.getNamespaceConfig();
      if (namespaceConfig == null) {
        namespaceConfig = new NamespaceConfig();
      }

      SerializerBuilder serializerBuilder = managementService.getSerializationService().newBuilder(name);
      serializerBuilder.withNamespace(new Namespace(namespaceConfig));

      if (config.isRegistrationRequired()) {
        serializerBuilder.withRegistrationRequired();
      }
      if (config.isCompatibleSerialization()) {
        serializerBuilder.withCompatibleSerialization();
      }

      if (config.getElementType() != null) {
        serializerBuilder.addType(config.getElementType());
      }
      if (!config.getExtraTypes().isEmpty()) {
        serializerBuilder.withTypes(config.getExtraTypes().toArray(new Class<?>[config.getExtraTypes().size()]));
      }

      serializer = serializerBuilder.build();
    }
    return serializer;
  }
230025
public CacheConfigurationBuilder<K, V> add(ServiceConfiguration<?> configuration) {
    CacheConfigurationBuilder<K, V> otherBuilder = new CacheConfigurationBuilder<>(this);

    if (getExistingServiceConfiguration(configuration.getClass()) != null) {
      if (configuration instanceof DefaultCopierConfiguration) {
        DefaultCopierConfiguration<?> copierConfiguration = (DefaultCopierConfiguration<?>) configuration;
        otherBuilder.removeExistingCopierConfigFor(copierConfiguration.getType());
      } else if (configuration instanceof DefaultSerializerConfiguration) {
        DefaultSerializerConfiguration<?> serializerConfiguration = (DefaultSerializerConfiguration<?>) configuration;
        otherBuilder.removeExistingSerializerConfigFor(serializerConfiguration.getType());
      } else if (!(configuration instanceof DefaultCacheEventListenerConfiguration)) {
        throw new IllegalStateException("Cannot add a generic service configuration when another one already exists. " +
                                        "Rely on specific with* methods or make sure your remove other configuration first.");
      }
    }
    otherBuilder.serviceConfigurations.add(configuration);
    return otherBuilder;
  }
603298
public function register($serializer)
    {
        if (is_array($serializer)) {
            foreach ($serializer as $s) {
                $this->register($s);
            }

            return $this;
        }

        if (is_string($serializer)) {
            if (!class_exists($serializer)) {
                throw new SerializersPoolException("Serializer class '{$serializer}' not found");
            }

            $serializer = new $serializer;
        }

        if (!is_object($serializer)) {
            $serializer_type = gettype($serializer);
            throw new SerializersPoolException("Serializer should be object or class name, scalar '{$serializer_type}' given instead");
        }

        if (!is_subclass_of($serializer, 'AMQPy\Serializers\SerializerInterface')) {
            $serializer_class = get_class($serializer);
            throw new SerializersPoolException("Serializer class '{$serializer_class}' doesn't implement default serializer interface");
        }

        $this->registered[$serializer->getContentType()] = $serializer;

        return $this;
    }
746557
public static <T> OptionalJsonSerializer<T> newInstance( JsonSerializer<T> serializer ) {
        return new OptionalJsonSerializer<T>( serializer );
    }
222756
private NormalizerSerializerStrategy getStrategy(Normalizer normalizer) {
        for (NormalizerSerializerStrategy strategy : strategies) {
            if (strategySupportsNormalizer(strategy, normalizer.getType(), normalizer.getClass())) {
                return strategy;
            }
        }
        throw new RuntimeException(String.format(
                "No serializer strategy found for normalizer of class %s. If this is a custom normalizer, you probably "
                        + "forgot to register a corresponding custom serializer strategy with this serializer.",
                normalizer.getClass()));
    }
826353
def get_serializer_class(configuration_model):
    
    class AutoConfigModelSerializer(ModelSerializer):
        """Serializer class for configuration models."""

        class Meta(object):
            """Meta information for AutoConfigModelSerializer."""
            model = configuration_model
            fields = '__all__'

        def create(self, validated_data):
            if "changed_by_username" in self.context:
                model = get_user_model()
                validated_data['changed_by'] = model.objects.get(username=self.context["changed_by_username"])
            return super(AutoConfigModelSerializer, self).create(validated_data)

    return AutoConfigModelSerializer
545153
public static <T> LinkedHashMultisetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new LinkedHashMultisetJsonDeserializer<T>( deserializer );
    }
1036670
public UserManagedCacheBuilder<K, V, T> withValueSerializer(Serializer<V> valueSerializer) {
    if (valueSerializer == null) {
      throw new NullPointerException("Null value serializer");
    }
    UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
    otherBuilder.valueSerializer = valueSerializer;
    return otherBuilder;
  }
416697
public <T> void setSerializer (Class<T> type, JsonSerializer<T> serializer) {
		classToSerializer.put(type, serializer);
	}