Example usage for com.fasterxml.jackson.databind.jsontype NamedType hasName

List of usage examples for com.fasterxml.jackson.databind.jsontype NamedType hasName

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind.jsontype NamedType hasName.

Prototype

public boolean hasName() 

Source Link

Usage

From source file:com.addthis.codec.jackson.CodecTypeIdResolver.java

public CodecTypeIdResolver(PluginMap pluginMap, JavaType baseType, TypeFactory typeFactory,
        Collection<NamedType> subtypes, PluginRegistry pluginRegistry) {
    super(baseType, typeFactory);
    this.pluginRegistry = pluginRegistry;
    if (!subtypes.isEmpty()) {
        BiMap<String, Class<?>> mutableExtraSubTypes = HashBiMap.create(subtypes.size());
        for (NamedType namedType : subtypes) {
            if (namedType.hasName()) {
                mutableExtraSubTypes.put(namedType.getName(), namedType.getType());
            }// www  .  jav a  2  s .  c o  m
        }
        this.extraSubTypes = Maps.unmodifiableBiMap(mutableExtraSubTypes);
    } else {
        this.extraSubTypes = ImmutableBiMap.of();
    }
    this.pluginMap = pluginMap;
}